summaryrefslogtreecommitdiff
path: root/gjs/module.cpp
diff options
context:
space:
mode:
authorEvan Welsh <contact@evanwelsh.com>2021-07-10 20:14:56 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2022-01-16 13:29:11 -0800
commit83e4c835cee6f8187cefd52b6a5fefca792ec6b5 (patch)
treed8e74874b98b281640a39445a74b2e2f3494da17 /gjs/module.cpp
parent3cab147af05d0ac243fecdba28c88d7cc785b24c (diff)
downloadgjs-83e4c835cee6f8187cefd52b6a5fefca792ec6b5.tar.gz
Some Object-related functions have moved to js/Object.h
- JS_[Get,Set]Private is now JS::[Get,Set]Private - JS_GetReservedSlot is now JS::GetReservedSlot - JS_SetReservedSlot still exists, but we'll update it now See https://bugzilla.mozilla.org/show_bug.cgi?id=1663365
Diffstat (limited to 'gjs/module.cpp')
-rw-r--r--gjs/module.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/gjs/module.cpp b/gjs/module.cpp
index ebd569b8..60a6b18d 100644
--- a/gjs/module.cpp
+++ b/gjs/module.cpp
@@ -24,6 +24,7 @@
#include <js/GCVector.h> // for RootedVector
#include <js/Id.h>
#include <js/Modules.h>
+#include <js/Object.h>
#include <js/Promise.h>
#include <js/PropertyDescriptor.h>
#include <js/Realm.h>
@@ -67,13 +68,13 @@ class GjsScriptModule {
/* Private data accessors */
[[nodiscard]] static inline GjsScriptModule* priv(JSObject* module) {
- return static_cast<GjsScriptModule*>(JS_GetPrivate(module));
+ return static_cast<GjsScriptModule*>(JS::GetPrivate(module));
}
/* Creates a JS module object. Use instead of the class's constructor */
[[nodiscard]] static JSObject* create(JSContext* cx, const char* name) {
JSObject* module = JS_NewObject(cx, &GjsScriptModule::klass);
- JS_SetPrivate(module, new GjsScriptModule(name));
+ JS::SetPrivate(module, new GjsScriptModule(name));
return module;
}