0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 12:51:52 +00:00

Merge pull request #385 from chrisbckr/require_return_array

Update v8js_methods.cc
This commit is contained in:
Stefan Siegl 2019-02-12 07:52:05 +01:00 committed by GitHub
commit 148bc50445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,6 +484,15 @@ V8JS_METHOD(require)
return;
}
if(Z_TYPE(module_code) == IS_ARRAY) {
v8::Local<v8::Value> newarray = zval_to_v8js(&module_code, isolate);
c->modules_loaded[normalised_module_id].Reset(isolate, newarray);
info.GetReturnValue().Set(newarray);
efree(normalised_path);
return;
}
if(Z_TYPE(module_code) == IS_OBJECT) {
v8::Local<v8::Object> newobj = zval_to_v8js(&module_code, isolate)->ToObject(isolate->GetEnteredContext()).ToLocalChecked();