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
+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)
{