Adapt JS API to ESR 140

This commit is contained in:
Itms
2025-09-03 12:03:53 +02:00
parent 3d5c59f2c9
commit edff153f73
8 changed files with 14 additions and 11 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ void Context::MaybeIncrementalGC()
#endif
// There is a tradeoff between this time and the number of frames we must run GCs on, but overall we should prioritize smooth framerates.
const js::SliceBudget GCSliceTimeBudget = js::SliceBudget(js::TimeBudget(6)); // Milliseconds an incremental slice is allowed to run. SM respects this fairly well.
const JS::SliceBudget GCSliceTimeBudget = JS::SliceBudget(JS::TimeBudget(6)); // Milliseconds an incremental slice is allowed to run. SM respects this fairly well.
PrepareZonesForIncrementalGC();
if (!JS::IsIncrementalGCInProgress(m_cx))
+1 -1
View File
@@ -24,7 +24,7 @@
#include <js/Initialization.h>
#include <list>
#if MOZJS_MAJOR_VERSION != 128
#if MOZJS_MAJOR_VERSION != 140
#error Your compiler is trying to use an incorrect major version of the \
SpiderMonkey library. The SpiderMonkey API is subject to changes, and the \
game will not build with the selected version of the library. Make sure \
+2 -1
View File
@@ -43,6 +43,7 @@
#include <js/ComparisonOperators.h>
#include <js/CompilationAndEvaluation.h>
#include <js/CompileOptions.h>
#include <js/EnvironmentChain.h>
#include <js/GCVector.h>
#include <js/GlobalObject.h>
#include <js/PropertyAndElement.h>
@@ -674,7 +675,7 @@ bool Interface::LoadScript(const VfsPath& filename, const std::string& code) con
JS::SourceText<mozilla::Utf8Unit> src;
ENSURE(src.init(rq.cx, code.c_str(), code.length(), JS::SourceOwnership::Borrowed));
JS::RootedObjectVector emptyScopeChain(rq.cx);
JS::EnvironmentChain emptyScopeChain{ rq.cx, JS::SupportUnscopables::No };
JS::RootedFunction func(rq.cx, JS::CompileFunction(rq.cx, emptyScopeChain, options, NULL, 0, NULL, src));
if (func == nullptr)
{
+3 -2
View File
@@ -69,9 +69,10 @@ void JobQueue::runJobs(JSContext*)
}
}
JSObject* JobQueue::getIncumbentGlobal(JSContext* cx)
bool JobQueue::getHostDefinedData(JSContext* cx, JS::MutableHandle<JSObject*> data) const
{
return JS::CurrentGlobalOrNull(cx);
data.set(JS::CurrentGlobalOrNull(cx));
return true;
}
bool JobQueue::enqueuePromiseJob(JSContext* cx, JS::HandleObject, JS::HandleObject job, JS::HandleObject,
+1 -1
View File
@@ -40,7 +40,7 @@ public:
void runJobs(JSContext*) final;
private:
JSObject* getIncumbentGlobal(JSContext* cx) final;
bool getHostDefinedData(JSContext* cx, JS::MutableHandle<JSObject*> data) const final;
bool enqueuePromiseJob(JSContext* cx, JS::HandleObject, JS::HandleObject job, JS::HandleObject,
JS::HandleObject) final;