Skip to content

Commit f258980

Browse files
committed
Accept empty string as module source
This might be perfectly valid, if you're using a third-party module, which requires a module yet doesn't use it in the code paths hit and hence you just want to stub it out.
1 parent 4853c6d commit f258980

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

v8js_methods.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,6 @@ V8JS_METHOD(require)
305305
convert_to_string(module_code);
306306
}
307307

308-
// Check that some code has been returned
309-
if (Z_STRLEN_P(module_code)==0) {
310-
zval_ptr_dtor(&module_code);
311-
efree(normalised_module_id);
312-
efree(normalised_path);
313-
314-
info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module loader callback did not return code")));
315-
return;
316-
}
317-
318308
// Create a template for the global object and set the built-in global functions
319309
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
320310
global->Set(V8JS_SYM("print"), v8::FunctionTemplate::New(isolate, V8JS_MN(print)), v8::ReadOnly);

0 commit comments

Comments
 (0)