Skip to content

Commit

Permalink
fix: forcibly enable FinalizationRegistry and iterator helpers
Browse files Browse the repository at this point in the history
Probably due to a bug in the build system, we could not use `JS::Prefs::setAtStartup_weakrefs(true);` or `JS::Prefs::setAtStartup_experimental_iterator_helpers(true);`:
```
undefined symbol: _ZN2JS5Prefs9weakrefs_E
```

Further more, the file `js/PrefsGenerated.h` does not get copied into the installation location of SpiderMonkey, but stays in `/js/src/_build/js/public/PrefsGenerated.h`.
  • Loading branch information
Xmader committed Jun 20, 2024
1 parent 0415557 commit 42e3f53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ sed -i'' -e 's/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./js/public/Class.h
sed -i'' -e 's/bool js::Unbox/JS_PUBLIC_API bool js::Unbox/g' ./js/src/vm/JSObject.cpp # same here
sed -i'' -e 's/shared_lib = self._pretty_path(libdef.output_path, backend_file)/shared_lib = libdef.lib_name/' ./python/mozbuild/mozbuild/backend/recursivemake.py
sed -i'' -e 's/if version < Version(mac_sdk_min_version())/if False/' ./build/moz.configure/toolchain.configure # do not verify the macOS SDK version as the reqiuired version is not available on Github Actions runner
sed -i'' -e 's/return JS::GetWeakRefsEnabled() == JS::WeakRefSpecifier::Disabled/return false/' ./js/src/vm/GlobalObject.cpp # forcibly enable FinalizationRegistry
sed -i'' -e 's/return !IsIteratorHelpersEnabled()/return false/' ./js/src/vm/GlobalObject.cpp # forcibly enable iterator helpers
cd js/src
mkdir -p _build
cd _build
Expand Down

0 comments on commit 42e3f53

Please sign in to comment.