mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 07:01:52 +00:00
Merge pull request #385 from chrisbckr/require_return_array
Update v8js_methods.cc
This commit is contained in:
commit
148bc50445
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user