Skip to content

Commit 148bc50

Browse files
authored
Merge pull request #385 from chrisbckr/require_return_array
Update v8js_methods.cc
2 parents 92a5b06 + d36aa6c commit 148bc50

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

v8js_methods.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,15 @@ V8JS_METHOD(require)
484484

485485
return;
486486
}
487+
488+
if(Z_TYPE(module_code) == IS_ARRAY) {
489+
v8::Local<v8::Value> newarray = zval_to_v8js(&module_code, isolate);
490+
c->modules_loaded[normalised_module_id].Reset(isolate, newarray);
491+
info.GetReturnValue().Set(newarray);
492+
493+
efree(normalised_path);
494+
return;
495+
}
487496

488497
if(Z_TYPE(module_code) == IS_OBJECT) {
489498
v8::Local<v8::Object> newobj = zval_to_v8js(&module_code, isolate)->ToObject(isolate->GetEnteredContext()).ToLocalChecked();

0 commit comments

Comments
 (0)