[js] Remove code to handle v8 < 5.0

We require at least node v6 which means v8 5.0, so code to handle
older v8 is no longer useful.
This commit is contained in:
Olly Betts 2021-12-02 14:02:59 +13:00
commit 7c97bd5ab3
7 changed files with 10 additions and 463 deletions

View file

@ -7,11 +7,7 @@ SWIGINTERN int
SWIG_AsCharPtrAndSize(SWIGV8_VALUE valRef, char** cptr, size_t* psize, int *alloc)
{
if(valRef->IsString()) {
%#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903)
v8::Handle<v8::String> js_str = v8::Handle<v8::String>::Cast(valRef);
%#else
v8::Local<v8::String> js_str = v8::Local<v8::String>::Cast(valRef);
%#endif
size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1;
char* cstr = (char*) %new_array(len, char);
@ -53,11 +49,7 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
// TODO: handle extra long strings
return SWIGV8_UNDEFINED();
} else {
%#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903)
v8::Handle<v8::String> js_str = SWIGV8_STRING_NEW2(carray, size);
%#else
v8::Local<v8::String> js_str = SWIGV8_STRING_NEW2(carray, size);
%#endif
return js_str;
}
} else {