Upgrading embedding from 115ESR to 128ESR. Any big changes?


It’s that time of the year again when the latest ESR version of firefox/spidermonkey has been released…
Thanks everyone for providing these releases for us to use.

I target the ESR versions to use in our embedding and hope to get some time over the next month to update our embedding from 115ESR to 128ESR.
Are there any significant features that have changed or any breaking API changes that I should be aware of?

If anybody has any information or can point me towards some documentation I would be very grateful.



I haven’t gotten around to writing any documentation yet or even annotating the commits but here’s a draft port of our codebase from 115 to 128: https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/936

No big breaking changes. The only one was that JS::WeakCache was made private due to it not being used elsewhere in Firefox, but it’s kindly being reinstated: https://bugzilla.mozilla.org/show_bug.cgi?id=1907070

You’ll need to grab this patch stack to fix a build bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1906736

Small changes that I encountered:

  • Column numbers of source locations are represented with a tagged type instead of uint32_t, and column numbers now count from 1 like line numbers do.
  • Creating an ArrayBuffer with an embedder-supplied buffer now takes a UniquePtr so you’ll probably have to refactor a bit.
  • JS::JobQueue implementations now have to implement isDrainingStopped().
  • Old JS_GetFunctionId replaced by two new functions: new JS_GetFunctionId that requires a JSContext, and JS_GetMaybePartialFunctionId that doesn’t. Same for JS_GetFunctionDisplayId.
  • JS::ErrorReport::filename is now JS::ConstUTF8CharsZ instead of const char*.

Continuing the discussion from Upgrading embedding from 115ESR to 128ESR. Any big changes?:

@ptomato, many thanks for getting back to me.
Can I ask what the change for JS::JobQueue is. Currently I just use
Will I have to do something different now?
Many thanks

Sorry, I left out a word in that item. (fixed now.) If you are not implementing your own JobQueue, for example to integrate with your event loop, you don’t have to change anything.