[gjs/mozjs102: 2/11] js: Various functions moved out of jsapi.h




commit 2eb8561e30a6ad1183a54b34a9d8ce15fb8e0f11
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue Jul 26 00:08:11 2022 -0700

    js: Various functions moved out of jsapi.h
    
    - js/CallAndConstruct.h: Now contains JS::Call, JS::Construct, and
      related
    - js/Debug.h: Already existed, but now contains JS_DefineDebuggerObject
    - js/GlobalObject.h: Now contains JS::CurrentGlobalOrNull
    - js/PropertyAndElement.h: Now contains APIs for getting, setting, and
      defining properties, as well as array elements
    - js/ScriptPrivate.h: Now contains JS::GetScriptPrivate/SetScriptPrivate
    - js/Stack.h: Now contains APIs that have to do with the call stack

 gi/arg.cpp                  | 3 ++-
 gi/boxed.cpp                | 1 +
 gi/closure.cpp              | 3 ++-
 gi/cwrapper.cpp             | 1 -
 gi/cwrapper.h               | 2 ++
 gi/enumeration.cpp          | 3 ++-
 gi/function.cpp             | 3 ++-
 gi/fundamental.cpp          | 1 +
 gi/gerror.cpp               | 5 ++++-
 gi/gobject.cpp              | 4 +++-
 gi/gtype.cpp                | 3 ++-
 gi/object.cpp               | 6 ++++--
 gi/param.cpp                | 3 ++-
 gi/private.cpp              | 3 ++-
 gi/repo.cpp                 | 5 ++++-
 gi/value.cpp                | 1 +
 gi/wrapperutils.h           | 3 ++-
 gjs/byteArray.cpp           | 3 ++-
 gjs/context.cpp             | 6 +++++-
 gjs/coverage.cpp            | 3 ++-
 gjs/debugger.cpp            | 3 ++-
 gjs/deprecation.cpp         | 2 +-
 gjs/engine.cpp              | 1 +
 gjs/gjs_pch.hh              | 6 ++++++
 gjs/global.cpp              | 3 +++
 gjs/importer.cpp            | 4 +++-
 gjs/internal.cpp            | 6 ++++--
 gjs/jsapi-dynamic-class.cpp | 4 +++-
 gjs/jsapi-util-error.cpp    | 7 +++++--
 gjs/jsapi-util.cpp          | 4 +++-
 gjs/module.cpp              | 8 ++++++--
 gjs/promise.cpp             | 3 ++-
 gjs/text-encoding.cpp       | 3 ++-
 modules/cairo-context.cpp   | 3 ++-
 modules/cairo-region.cpp    | 3 ++-
 modules/console.cpp         | 2 ++
 modules/print.cpp           | 1 +
 modules/system.cpp          | 3 ++-
 test/gjs-test-call-args.cpp | 2 +-
 test/gjs-tests.cpp          | 1 +
 40 files changed, 97 insertions(+), 34 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index b70f20044..d70476c11 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -20,6 +20,7 @@
 #include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
 #include <js/Exception.h>
 #include <js/GCVector.h>            // for RootedVector, MutableWrappedPtrOp...
+#include <js/PropertyAndElement.h>  // for JS_GetElement, JS_HasPropertyById
 #include <js/PropertyDescriptor.h>  // for JSPROP_ENUMERATE
 #include <js/RootingAPI.h>
 #include <js/String.h>
@@ -28,7 +29,7 @@
 #include <js/Value.h>
 #include <js/ValueArray.h>
 #include <js/experimental/TypedData.h>
-#include <jsapi.h>        // for JS_ReportOutOfMemory, JS_GetElement
+#include <jsapi.h>        // for InformalValueTypeName, IdVector
 #include <jsfriendapi.h>  // for JS_GetObjectFunction
 
 #include "gi/arg-inl.h"
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index c84cd4d46..549f0d8fc 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -20,6 +20,7 @@
 #include <js/GCHashTable.h>  // for GCHashMap
 #include <js/GCVector.h>     // for MutableWrappedPtrOperations
 #include <js/Object.h>       // for SetReservedSlot
+#include <js/PropertyAndElement.h>  // for JS_DefineFunction, JS_Enumerate
 #include <js/String.h>
 #include <js/TracingAPI.h>
 #include <js/TypeDecls.h>
diff --git a/gi/closure.cpp b/gi/closure.cpp
index 288550a05..4d85a60ad 100644
--- a/gi/closure.cpp
+++ b/gi/closure.cpp
@@ -8,11 +8,12 @@
 
 #include <glib.h>  // for g_assert
 
+#include <js/CallAndConstruct.h>
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>  // for JS_IsExceptionPending, Call, JS_Get...
+#include <jsapi.h>  // for JS_GetFunctionObject
 
 #include "gi/closure.h"
 #include "gjs/context-private.h"
diff --git a/gi/cwrapper.cpp b/gi/cwrapper.cpp
index f5fbff8a7..c6cca867f 100644
--- a/gi/cwrapper.cpp
+++ b/gi/cwrapper.cpp
@@ -9,7 +9,6 @@
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
-#include <jsapi.h>  // for JS_DefinePropertyById
 
 #include "gi/cwrapper.h"
 #include "gi/gtype.h"
diff --git a/gi/cwrapper.h b/gi/cwrapper.h
index 159479e15..bbcd216c5 100644
--- a/gi/cwrapper.h
+++ b/gi/cwrapper.h
@@ -16,8 +16,10 @@
 
 #include <js/CallArgs.h>
 #include <js/Class.h>
+#include <js/GlobalObject.h>  // for CurrentGlobalOrNull
 #include <js/Id.h>
 #include <js/Object.h>  // for GetClass
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>
diff --git a/gi/enumeration.cpp b/gi/enumeration.cpp
index 62090ce4a..bc0e8274d 100644
--- a/gi/enumeration.cpp
+++ b/gi/enumeration.cpp
@@ -8,9 +8,10 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
-#include <jsapi.h>  // for JS_DefineProperty, JS_NewPlainObject
+#include <jsapi.h>  // for JS_NewPlainObject
 
 #include "gi/cwrapper.h"
 #include "gi/enumeration.h"
diff --git a/gi/function.cpp b/gi/function.cpp
index af739ecd7..8cce6834a 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -22,6 +22,7 @@
 #include <js/Class.h>
 #include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
 #include <js/Exception.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT
 #include <js/PropertySpec.h>
 #include <js/Realm.h>  // for GetRealmFunctionPrototype
@@ -31,7 +32,7 @@
 #include <js/Value.h>
 #include <js/ValueArray.h>
 #include <js/Warnings.h>
-#include <jsapi.h>        // for HandleValueArray, JS_GetElement
+#include <jsapi.h>        // for HandleValueArray
 #include <jspubtd.h>      // for JSProtoKey
 
 #include "gi/arg-cache.h"
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index 56cf2dc05..ae8001586 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -13,6 +13,7 @@
 #include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
 #include <js/GCHashTable.h>  // for WeakCache
 #include <js/Object.h>       // for GetClass
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index ba70005b2..916824537 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -11,17 +11,20 @@
 #include <girepository.h>
 #include <glib-object.h>
 
+#include <js/CallAndConstruct.h>
 #include <js/CallArgs.h>
 #include <js/Class.h>
 #include <js/Exception.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_ENUMERATE
 #include <js/RootingAPI.h>
 #include <js/SavedFrameAPI.h>
+#include <js/Stack.h>  // for BuildStackString, CaptureCurrentStack
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>    // for JS_DefinePropertyById, JS_GetProp...
+#include <jsapi.h>    // for InformalValueTypeName, JS_GetClassObject
 #include <jspubtd.h>  // for JSProtoKey, JSProto_Error, JSProt...
 
 #include "gi/arg-inl.h"
diff --git a/gi/gobject.cpp b/gi/gobject.cpp
index 2ab1f28ba..914f6176d 100644
--- a/gi/gobject.cpp
+++ b/gi/gobject.cpp
@@ -10,13 +10,15 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include <js/CallAndConstruct.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_READONLY
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>  // for JS_SetProperty, JS_DefineProperty
+#include <jsapi.h>  // for JS_NewPlainObject
 #include <mozilla/Maybe.h>
 
 #include "gi/gobject.h"
diff --git a/gi/gtype.cpp b/gi/gtype.cpp
index 3b0b8b801..58efef008 100644
--- a/gi/gtype.cpp
+++ b/gi/gtype.cpp
@@ -12,11 +12,12 @@
 #include <js/CallArgs.h>
 #include <js/Class.h>
 #include <js/GCHashTable.h>         // for WeakCache
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
-#include <jsapi.h>  // for JS_GetPropertyById, JS_AtomizeString
+#include <jsapi.h>  // for JS_NewObjectWithGivenProto
 #include <mozilla/HashTable.h>
 
 #include "gi/cwrapper.h"
diff --git a/gi/object.cpp b/gi/object.cpp
index 6cf97c723..7bceffa0b 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -22,6 +22,7 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include <js/CallAndConstruct.h>  // for IsCallable, JS_CallFunctionValue
 #include <js/CallArgs.h>
 #include <js/CharacterEncoding.h>
 #include <js/Class.h>
@@ -31,6 +32,7 @@
 #include <js/GCVector.h>            // for MutableWrappedPtrOperations
 #include <js/HeapAPI.h>
 #include <js/MemoryFunctions.h>     // for AddAssociatedMemory, RemoveAssoci...
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT, JSPROP_READONLY
 #include <js/String.h>
 #include <js/Symbol.h>
@@ -39,8 +41,8 @@
 #include <js/Value.h>
 #include <js/ValueArray.h>
 #include <js/Warnings.h>
-#include <jsapi.h>        // for IsCallable
-#include <jsfriendapi.h>  // for JS_GetObjectFunction, IsFunctionO...
+#include <jsapi.h>        // for JS_GetFunctionObject, IdVector
+#include <jsfriendapi.h>  // for JS_GetObjectFunction, GetFunctionNativeReserved
 #include <mozilla/HashTable.h>
 
 #include "gi/arg-inl.h"
diff --git a/gi/param.cpp b/gi/param.cpp
index 5f419db99..0c4e04099 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -12,11 +12,12 @@
 #include <js/CallArgs.h>
 #include <js/Class.h>
 #include <js/Object.h>  // for GetClass
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
-#include <jsapi.h>       // for JS_GetPropertyById
+#include <jsapi.h>       // for JS_NewObjectForConstructor, JS_NewObjectWithG...
 #include <jspubtd.h>     // for JSProto_TypeError
 
 #include "gi/cwrapper.h"
diff --git a/gi/private.cpp b/gi/private.cpp
index 85001cb6e..02332b18b 100644
--- a/gi/private.cpp
+++ b/gi/private.cpp
@@ -12,12 +12,13 @@
 
 #include <js/Array.h>  // for JS::GetArrayLength,
 #include <js/CallArgs.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/ValueArray.h>
-#include <jsapi.h>       // for JS_GetElement
+#include <jsapi.h>  // for JS_NewPlainObject
 
 #include "gi/gobject.h"
 #include "gi/gtype.h"
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 221cf8c79..ab23677ff 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -15,11 +15,14 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include <js/CallAndConstruct.h>  // for JS_CallFunctionValue
 #include <js/Class.h>
 #include <js/ComparisonOperators.h>
 #include <js/Exception.h>
+#include <js/GlobalObject.h>        // for CurrentGlobalOrNull
 #include <js/Id.h>                  // for PropertyKey
 #include <js/Object.h>              // for GetClass
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT, JSPROP_RESOLVING
 #include <js/RootingAPI.h>
 #include <js/String.h>
@@ -28,7 +31,7 @@
 #include <js/Value.h>
 #include <js/ValueArray.h>
 #include <js/Warnings.h>
-#include <jsapi.h>  // for JS_DefinePropertyById, JS_GetProp...
+#include <jsapi.h>  // for JS_NewPlainObject, JS_NewObject
 
 #include "gi/arg.h"
 #include "gi/boxed.h"
diff --git a/gi/value.cpp b/gi/value.cpp
index bd2def882..d7b12bc5f 100644
--- a/gi/value.cpp
+++ b/gi/value.cpp
@@ -18,6 +18,7 @@
 #include <js/Conversions.h>
 #include <js/Exception.h>
 #include <js/GCVector.h>  // for RootedVector
+#include <js/PropertyAndElement.h>
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
diff --git a/gi/wrapperutils.h b/gi/wrapperutils.h
index 0b87f7cdf..719a78ccf 100644
--- a/gi/wrapperutils.h
+++ b/gi/wrapperutils.h
@@ -22,9 +22,10 @@
 #include <js/Id.h>
 #include <js/MemoryFunctions.h>
 #include <js/Object.h>
+#include <js/PropertyAndElement.h>  // for JS_DefineFunctionById
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
-#include <jsapi.h>       // for JS_GetPrototype, JS_DefineFunctionById
+#include <jsapi.h>       // for JS_GetPrototype
 #include <jspubtd.h>     // for JSProto_TypeError
 
 #include "gi/arg-inl.h"
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 455075fa7..e0b7a03b8 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -11,12 +11,13 @@
 
 #include <js/ArrayBuffer.h>
 #include <js/CallArgs.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>   // for UniqueChars
 #include <js/experimental/TypedData.h>
-#include <jsapi.h>        // for JS_DefineFunctionById, JS_DefineFun...
+#include <jsapi.h>  // for JS_NewPlainObject
 
 #include "gi/boxed.h"
 #include "gjs/atoms.h"
diff --git a/gjs/context.cpp b/gjs/context.cpp
index a9dde93db..8bbebf84a 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -36,6 +36,7 @@
 #endif
 
 #include <js/AllocPolicy.h>  // for SystemAllocPolicy
+#include <js/CallAndConstruct.h>  // for Call, JS_CallFunctionValue
 #include <js/CallArgs.h>     // for UndefinedHandleValue
 #include <js/CharacterEncoding.h>
 #include <js/CompilationAndEvaluation.h>
@@ -46,12 +47,15 @@
 #include <js/GCAPI.h>               // for JS_GC, JS_AddExtraGCRootsTr...
 #include <js/GCHashTable.h>         // for WeakCache
 #include <js/GCVector.h>            // for RootedVector
+#include <js/GlobalObject.h>        // for CurrentGlobalOrNull
 #include <js/Id.h>
 #include <js/Modules.h>
 #include <js/Promise.h>             // for JobQueue::SavedJobQueue
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT, JSPROP_RE...
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
+#include <js/ScriptPrivate.h>
 #include <js/SourceText.h>
 #include <js/TracingAPI.h>
 #include <js/TypeDecls.h>
@@ -59,7 +63,7 @@
 #include <js/Value.h>
 #include <js/ValueArray.h>
 #include <js/friend/DumpFunctions.h>
-#include <jsapi.h>        // for Call, CurrentGlobalOrNull
+#include <jsapi.h>        // for JS_GetFunctionObject, JS_Ge...
 #include <jsfriendapi.h>  // for ScriptEnvironmentPreparer
 #include <mozilla/UniquePtr.h>
 
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 7dcc20db3..487268d48 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -14,6 +14,7 @@
 #include <glib-object.h>
 
 #include <js/GCAPI.h>  // for JS_AddExtraGCRootsTracer, JS_Remove...
+#include <js/PropertyAndElement.h>
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
 #include <js/TracingAPI.h>
@@ -21,7 +22,7 @@
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/experimental/CodeCoverage.h>  // for EnableCodeCoverage
-#include <jsapi.h>                         // for JS_SetPropertyById
+#include <jsapi.h>                         // for JS_WrapObject
 
 #include "gjs/atoms.h"
 #include "gjs/context-private.h"
diff --git a/gjs/debugger.cpp b/gjs/debugger.cpp
index 310fa3843..43982e105 100644
--- a/gjs/debugger.cpp
+++ b/gjs/debugger.cpp
@@ -15,6 +15,7 @@
 #include <glib.h>
 
 #include <js/CallArgs.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertySpec.h>
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
@@ -22,7 +23,7 @@
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
-#include <jsapi.h>  // for JS_DefineFunctions, JS_SetPropertyById
+#include <jsapi.h>  // for JS_WrapObject
 
 #include "gjs/atoms.h"
 #include "gjs/context-private.h"
diff --git a/gjs/deprecation.cpp b/gjs/deprecation.cpp
index f51e9880d..c0382d596 100644
--- a/gjs/deprecation.cpp
+++ b/gjs/deprecation.cpp
@@ -16,11 +16,11 @@
 #include <js/CharacterEncoding.h>
 #include <js/Conversions.h>
 #include <js/RootingAPI.h>
+#include <js/Stack.h>  // for CaptureCurrentStack, MaxFrames
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/friend/DumpFunctions.h>
-#include <jsapi.h>        // for MaxFrames, CaptureCurrentStack
 
 #include "gjs/deprecation.h"
 #include "gjs/macros.h"
diff --git a/gjs/engine.cpp b/gjs/engine.cpp
index 16d84cc19..305a628b8 100644
--- a/gjs/engine.cpp
+++ b/gjs/engine.cpp
@@ -21,6 +21,7 @@
 #include <js/Initialization.h>  // for JS_Init, JS_ShutDown
 #include <js/Promise.h>
 #include <js/RootingAPI.h>
+#include <js/Stack.h>  // for JS_SetNativeStackQuota
 #include <js/TypeDecls.h>
 #include <js/Warnings.h>
 #include <js/experimental/SourceHook.h>
diff --git a/gjs/gjs_pch.hh b/gjs/gjs_pch.hh
index d4a820ff8..f8d5c9156 100644
--- a/gjs/gjs_pch.hh
+++ b/gjs/gjs_pch.hh
@@ -53,6 +53,7 @@
 #include <js/Array.h>
 #include <js/ArrayBuffer.h>
 #include <js/BigInt.h>
+#include <js/CallAndConstruct.h>
 #include <js/CallArgs.h>
 #include <js/CharacterEncoding.h>
 #include <js/Class.h>
@@ -62,12 +63,14 @@
 #include <js/Context.h>
 #include <js/ContextOptions.h>
 #include <js/Conversions.h>
+#include <js/Debug.h>
 #include <js/ErrorReport.h>
 #include <js/Exception.h>
 #include <js/GCAPI.h>
 #include <js/GCHashTable.h>
 #include <js/GCPolicyAPI.h>
 #include <js/GCVector.h>
+#include <js/GlobalObject.h>
 #include <js/HashTable.h>
 #include <js/HeapAPI.h>
 #include <js/Id.h>
@@ -79,13 +82,16 @@
 #include <js/ProfilingCategory.h>
 #include <js/ProfilingStack.h>
 #include <js/Promise.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>
 #include <js/PropertySpec.h>
 #include <js/Realm.h>
 #include <js/RealmOptions.h>
 #include <js/RootingAPI.h>
 #include <js/SavedFrameAPI.h>
+#include <js/ScriptPrivate.h>
 #include <js/SourceText.h>
+#include <js/Stack.h>
 #include <js/String.h>
 #include <js/Symbol.h>
 #include <js/TracingAPI.h>
diff --git a/gjs/global.cpp b/gjs/global.cpp
index 9c2c91eb1..848b41566 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -16,9 +16,12 @@
 #include <js/Class.h>
 #include <js/CompilationAndEvaluation.h>
 #include <js/CompileOptions.h>
+#include <js/Debug.h>         // for JS_DefineDebuggerObject
+#include <js/GlobalObject.h>  // for CurrentGlobalOrNull, JS_NewGlobalObject
 #include <js/Id.h>
 #include <js/MapAndSet.h>
 #include <js/Object.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT, JSPROP_RE...
 #include <js/PropertySpec.h>
 #include <js/Realm.h>  // for GetObjectRealmOrNull, SetRealmPrivate
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 78e21e2e3..a8607dec5 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -24,8 +24,10 @@
 #include <js/ComparisonOperators.h>
 #include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
 #include <js/Exception.h>
+#include <js/GlobalObject.h>  // for CurrentGlobalOrNull
 #include <js/Id.h>  // for PropertyKey
 #include <js/Object.h>  // for GetClass
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
@@ -34,7 +36,7 @@
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
-#include <jsapi.h>    // for JS_DefinePropertyById, JS_DefineP...
+#include <jsapi.h>    // for JS_NewPlainObject, IdVector, JS_...
 #include <jspubtd.h>  // for JSProto_Error
 #include <mozilla/Maybe.h>
 #include <mozilla/UniquePtr.h>
diff --git a/gjs/internal.cpp b/gjs/internal.cpp
index 9ffe48136..414d93750 100644
--- a/gjs/internal.cpp
+++ b/gjs/internal.cpp
@@ -14,6 +14,7 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include <js/CallAndConstruct.h>  // for JS_CallFunction
 #include <js/CallArgs.h>
 #include <js/CharacterEncoding.h>
 #include <js/CompilationAndEvaluation.h>
@@ -22,6 +23,7 @@
 #include <js/GCAPI.h>  // for JS_AddExtraGCRootsTracer
 #include <js/Modules.h>
 #include <js/Promise.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
@@ -32,8 +34,8 @@
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>  // for JS_DefinePropertyById, ...
-#include <jsfriendapi.h>
+#include <jsapi.h>        // for JS_NewPlainObject, JS_ObjectIsFunction
+#include <jsfriendapi.h>  // for JS_GetObjectFunction, SetFunctionNativeReserved
 #include <jspubtd.h>  // for JSProto_Error
 
 #include "gjs/context-private.h"
diff --git a/gjs/jsapi-dynamic-class.cpp b/gjs/jsapi-dynamic-class.cpp
index b36c0bf85..2bc4823ca 100644
--- a/gjs/jsapi-dynamic-class.cpp
+++ b/gjs/jsapi-dynamic-class.cpp
@@ -9,16 +9,18 @@
 
 #include <glib.h>
 
+#include <js/CallAndConstruct.h>
 #include <js/CallArgs.h>  // for JSNative
 #include <js/Class.h>
 #include <js/ComparisonOperators.h>
 #include <js/Object.h>              // for GetClass
+#include <js/PropertyAndElement.h>  // for JS_DefineFunctions, JS_DefinePro...
 #include <js/Realm.h>  // for GetRealmObjectPrototype
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>        // for JS_DefineFunctions, JS_DefineProp...
+#include <jsapi.h>        // for JS_GetFunctionObject, JS_GetPrototype
 #include <jsfriendapi.h>  // for GetFunctionNativeReserved, NewFun...
 #include <jspubtd.h>      // for JSProto_TypeError
 
diff --git a/gjs/jsapi-util-error.cpp b/gjs/jsapi-util-error.cpp
index c003904b9..800743331 100644
--- a/gjs/jsapi-util-error.cpp
+++ b/gjs/jsapi-util-error.cpp
@@ -9,17 +9,20 @@
 #include <glib.h>
 
 #include <js/AllocPolicy.h>
+#include <js/CallAndConstruct.h>
 #include <js/CharacterEncoding.h>
 #include <js/ErrorReport.h>
 #include <js/Exception.h>
 #include <js/GCHashTable.h>  // for GCHashSet
 #include <js/HashTable.h>    // for DefaultHasher
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
+#include <js/Stack.h>  // for BuildStackString
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/ValueArray.h>
-#include <jsapi.h>       // for BuildStackString, Construct, JS_GetClassObject
-#include <jspubtd.h>     // for JSProtoKey, JSProto_Error, JSProto...
+#include <jsapi.h>              // for JS_GetClassObject
+#include <jspubtd.h>            // for JSProtoKey, JSProto_Error, JSProto...
 #include <mozilla/HashTable.h>  // for HashSet<>::AddPtr
 
 #include "gjs/atoms.h"
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 3acb66421..7dc86fe87 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -30,12 +30,14 @@
 #include <js/GCVector.h>  // for RootedVector
 #include <js/HashTable.h>  // for DefaultHasher
 #include <js/Object.h>    // for GetClass
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
+#include <js/Stack.h>  // for BuildStackString
 #include <js/String.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>        // for JS_GetPropertyById, JS_InstanceOf
+#include <jsapi.h>        // for JS_InstanceOf
 #include <jsfriendapi.h>  // for ProtoKeyToClass
 #include <mozilla/HashTable.h>  // for HashSet::AddPtr
 
diff --git a/gjs/module.cpp b/gjs/module.cpp
index c8d4b21c0..cf9eaf372 100644
--- a/gjs/module.cpp
+++ b/gjs/module.cpp
@@ -12,6 +12,7 @@
 #include <gio/gio.h>
 #include <glib.h>
 
+#include <js/CallAndConstruct.h>
 #include <js/CallArgs.h>
 #include <js/CharacterEncoding.h>  // for ConstUTF8CharsZ
 #include <js/Class.h>
@@ -21,21 +22,24 @@
 #include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
 #include <js/Exception.h>
 #include <js/GCVector.h>  // for RootedVector
+#include <js/GlobalObject.h>  // for CurrentGlobalOrNull
 #include <js/Id.h>
 #include <js/Modules.h>
 #include <js/Object.h>
 #include <js/Promise.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>
 #include <js/Realm.h>
 #include <js/RootingAPI.h>
+#include <js/ScriptPrivate.h>
 #include <js/SourceText.h>
 #include <js/String.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/ValueArray.h>
-#include <jsapi.h>  // for JS_DefinePropertyById, ...
-#include <jsfriendapi.h>  // for SetFunctionNativeReserved
+#include <jsapi.h>        // for JS_GetFunctionObject, JS_Ne...
+#include <jsfriendapi.h>  // for NewFunctionWithReserved
 #include <mozilla/Maybe.h>
 
 #include "gjs/atoms.h"
diff --git a/gjs/promise.cpp b/gjs/promise.cpp
index 0ce4bd7c5..741279607 100644
--- a/gjs/promise.cpp
+++ b/gjs/promise.cpp
@@ -10,10 +10,11 @@
 #include <glib-object.h>
 
 #include <js/CallArgs.h>
+#include <js/PropertyAndElement.h>  // for JS_DefineFunctions
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
-#include <jsapi.h>  // for JS_DefineFunctions, JS_NewPlainObject
+#include <jsapi.h>  // for JS_NewPlainObject
 
 #include "gjs/context-private.h"
 #include "gjs/jsapi-util.h"
diff --git a/gjs/text-encoding.cpp b/gjs/text-encoding.cpp
index e9010023b..95a6f86c8 100644
--- a/gjs/text-encoding.cpp
+++ b/gjs/text-encoding.cpp
@@ -26,6 +26,7 @@
 #include <js/ErrorReport.h>  // for JS_ReportOutOfMemory
 #include <js/Exception.h>    // for JS_ClearPendingException, JS_...
 #include <js/GCAPI.h>  // for AutoCheckCannotGC
+#include <js/PropertyAndElement.h>
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/String.h>
@@ -33,7 +34,7 @@
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
 #include <js/experimental/TypedData.h>
-#include <jsapi.h>        // for JS_DefineFunctionById, JS_DefineFun...
+#include <jsapi.h>        // for JS_NewPlainObject, JS_InstanceOf
 #include <jsfriendapi.h>  // for ProtoKeyToClass
 #include <jspubtd.h>      // for JSProto_TypeError, JSProto_InternalError
 #include <mozilla/Maybe.h>
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index 356ba4562..2f59a6868 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -13,13 +13,14 @@
 #include <js/Array.h>  // for JS::NewArrayObject
 #include <js/CallArgs.h>
 #include <js/Conversions.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_READONLY
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
 #include <js/Value.h>
-#include <jsapi.h>  // for JS_SetElement
+#include <jsapi.h>  // for JS_NewPlainObject
 
 #include "gi/arg-inl.h"
 #include "gi/arg.h"
diff --git a/modules/cairo-region.cpp b/modules/cairo-region.cpp
index a6333f777..84c449f40 100644
--- a/modules/cairo-region.cpp
+++ b/modules/cairo-region.cpp
@@ -9,12 +9,13 @@
 
 #include <js/CallArgs.h>
 #include <js/Conversions.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_READONLY
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>
-#include <jsapi.h>  // for JS_GetPropertyById, JS_SetPropert...
+#include <jsapi.h>  // for JS_NewPlainObject
 
 #include "gi/arg-inl.h"
 #include "gi/arg.h"
diff --git a/modules/console.cpp b/modules/console.cpp
index 33c189f9c..2f4e19610 100644
--- a/modules/console.cpp
+++ b/modules/console.cpp
@@ -27,12 +27,14 @@
 #include <glib.h>
 #include <glib/gprintf.h>  // for g_fprintf
 
+#include <js/CallAndConstruct.h>
 #include <js/CallArgs.h>
 #include <js/CharacterEncoding.h>  // for JS_EncodeStringToUTF8
 #include <js/CompilationAndEvaluation.h>
 #include <js/CompileOptions.h>
 #include <js/ErrorReport.h>
 #include <js/Exception.h>
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
 #include <js/SourceText.h>
 #include <js/TypeDecls.h>
diff --git a/modules/print.cpp b/modules/print.cpp
index e483446c7..c861da493 100644
--- a/modules/print.cpp
+++ b/modules/print.cpp
@@ -13,6 +13,7 @@
 #include <js/CharacterEncoding.h>  // for JS_EncodeStringToUTF8
 #include <js/Conversions.h>
 #include <js/Exception.h>
+#include <js/PropertyAndElement.h>  // for JS_DefineFunctions
 #include <js/PropertySpec.h>  // for JS_FN, JSFunctionSpec, JS_FS_END
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
diff --git a/modules/system.cpp b/modules/system.cpp
index 0f4410969..9c43830ec 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -18,13 +18,14 @@
 #include <js/Date.h>                // for ResetTimeZone
 #include <js/GCAPI.h>               // for JS_GC
 #include <js/JSON.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertyDescriptor.h>  // for JSPROP_READONLY
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/TypeDecls.h>
 #include <js/Value.h>     // for NullValue
 #include <js/friend/DumpFunctions.h>
-#include <jsapi.h>        // for JS_DefinePropertyById, JS_DefineF...
+#include <jsapi.h>        // for JS_GetFunctionObject, JS_NewPlainObject
 #include <jsfriendapi.h>  // for GetFunctionNativeReserved, NewFunctionByIdW...
 
 #include "gi/object.h"
diff --git a/test/gjs-test-call-args.cpp b/test/gjs-test-call-args.cpp
index fccd9c225..15454d2dd 100644
--- a/test/gjs-test-call-args.cpp
+++ b/test/gjs-test-call-args.cpp
@@ -11,13 +11,13 @@
 #include <js/CallArgs.h>
 #include <js/CompilationAndEvaluation.h>
 #include <js/CompileOptions.h>
+#include <js/PropertyAndElement.h>
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
 #include <js/SourceText.h>
 #include <js/String.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
-#include <jsapi.h>       // for JS_DefineFunctions
 
 #include "gjs/jsapi-util-args.h"
 #include "gjs/jsapi-util.h"
diff --git a/test/gjs-tests.cpp b/test/gjs-tests.cpp
index ecf986fbd..852ee11d0 100644
--- a/test/gjs-tests.cpp
+++ b/test/gjs-tests.cpp
@@ -21,6 +21,7 @@
 #include <js/CharacterEncoding.h>
 #include <js/Exception.h>
 #include <js/Id.h>
+#include <js/PropertyAndElement.h>
 #include <js/RootingAPI.h>
 #include <js/String.h>
 #include <js/TypeDecls.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]