[napi] Support import and require of .node modules

This commit is contained in:
Jarred Sumner
2022-05-09 00:24:25 -07:00
parent 3bd83eb134
commit 8014a0b8d8
6 changed files with 80 additions and 53 deletions

View File

@@ -146,7 +146,7 @@ static JSC_DEFINE_HOST_FUNCTION(Process_functionDlopen,
if (!napi_register_module_v1) {
dlclose(handle);
JSC::throwTypeError(globalObject, scope, "dlopen failed to napi_register_module_v1"_s);
JSC::throwTypeError(globalObject, scope, "symbol 'napi_register_module_v1' not found in native module. Is this a Node API (napi) module?"_s);
return JSC::JSValue::encode(JSC::JSValue {});
}