diff options
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r-- | js/src/jsapi.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index dab4c25a4..74d64e312 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -4691,15 +4691,27 @@ JS::CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options, } JS_PUBLIC_API(void) -JS::SetModuleHostDefinedField(JSObject* module, const JS::Value& value) +JS::SetModulePrivate(JSObject* module, const JS::Value& value) { - module->as<ModuleObject>().setHostDefinedField(value); + module->as<ModuleObject>().scriptSourceObject()->setPrivate(value); } JS_PUBLIC_API(JS::Value) -JS::GetModuleHostDefinedField(JSObject* module) +JS::GetModulePrivate(JSObject* module) { - return module->as<ModuleObject>().hostDefinedField(); + return module->as<ModuleObject>().scriptSourceObject()->getPrivate(); +} + +JS_PUBLIC_API(void) +JS::SetScriptPrivate(JSScript* script, const JS::Value& value) +{ + script->scriptSourceUnwrap().setPrivate(value); +} + +JS_PUBLIC_API(JS::Value) +JS::GetScriptPrivate(JSScript* script) +{ + return script->scriptSourceUnwrap().getPrivate(); } JS_PUBLIC_API(bool) |