You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Already ours: the root entry aliases the object it loaded, so a WASI
722
+
// fallback candidate — or a `NAPI_RS_NATIVE_LIBRARY_PATH` override that
723
+
// is a generated loader — arrives already stamped with this same value.
724
+
returntarget
725
+
}
726
+
consterror=newError(
727
+
'`__napiBindingTarget` is reserved by the generated binding loader, but the loaded binding already exports it. Rename the export, e.g. #[napi(js_name = "...")].',
728
+
)
729
+
error.code='ERR_NAPI_BINDING_TARGET_CONFLICT'
730
+
throwerror
731
+
}
732
+
if(!Object.isExtensible(exportsObject)){
733
+
// A `#[napi(module_exports)]` hook may seal or freeze this object
734
+
// (`Object::seal` / `Object::freeze`). Reporting the artifact is metadata,
735
+
// never a reason to fail an otherwise successful load, so the stamp is
736
+
// skipped. What a consumer still sees then follows the entry point: the
737
+
// browser and deferred loaders declare `__napiBindingTarget` at module
738
+
// level and go on reporting it, while the CommonJS entries hand back this
739
+
// very object as `module.exports`, so there the value is absent.
740
+
returntarget
741
+
}
742
+
try{
743
+
// [[Define]], not [[Set]]: an ordinary assignment walks the prototype
744
+
// chain, so an inherited accessor could swallow the value or throw and
745
+
// fail an otherwise successful load. The descriptor is what a successful
0 commit comments