Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

SpiderMonkey 45

This article needs a technical review. How you can help.

Draft
This page is not complete.

These release notes are an incomplete draft and will remain so well after SpiderMonkey 45 is released.

The Mozilla JavaScript team is pleased to announce the release of SpiderMonkey 45. You can download full source code here: https://people.mozilla.org/~sfink/mozjs-45.0.2.tar.bz2

SHA256: 570530b1e551bf4a459d7cae875f33f99d5ef0c29ccc7742a1b6f588e5eadbee
MD5: 2ca34f998d8b5ea79d8616dd26b5fbab
 

SpiderMonkey 45 is the JavaScript engine that shipped in Firefox 45. It continues to improve performance over previous SpiderMonkey releases. It also contains new language and API features described in detail below.

Please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. Or file bugs at bugzilla.mozilla.org under Product: Core, Component: JavaScript engine. You may wish to make the bugs block bug 837921 (aliased as "sm.embedding").

Apr 14, 2016

Platform support

SpiderMonkey 45 is supported on all platforms able to run Firefox 45.  Compiling it requires a C++ compiler, and the JSAPI can only be used from C++ code.  If you are compiling with Microsoft's Visual Studio, note the minimum supported version is MSVC 2013.

SpiderMonkey 45 includes a just-in-time compiler (JIT) that compiles JavaScript to machine code, for a significant speed increase. It is supported on x86, x86_64, and ARM architectures. On several other platforms (SPARC, MIPS), the JIT is provided but not supported.  On remaining platforms the JIT is disabled; JavaScript code runs in an interpreter, as it has in previous versions. It's the same language, just not as fast.

Migrating to SpiderMonkey 45

SpiderMonkey 45 is not binary-compatible with previous releases, nor is it source-code compatible. Many JSAPI types; functions, and callback signatures, have changed though most functions that have retain their previous name, providing relatively unchanged functionality. Applications will require significant changes, but most changes will be automatically detected by the C/C++ compiler, making them easy to detect and updating the code a relatively straightforward job. Here is a list of the most significant changes:

  • JS::NullPtr is obselete. You should now use nullptr instead. (Supporting decltype(nullptr)).

New JavaScript language features

JavaScript 45 includes significant updates to its language features, yo.

New C++ APIs

JSAPI is a C++ exlcusive API. Please note that SpiderMonkey reserves the JS:: namespace for itself (and subsequently the js:: namespace for internal use).

Deleted APIs

Changed APIs

  • JS_Init has moved from jsapi.h to js/Initialization.h
  • JS_ShutDown has moved from jsapi.h to js/Initialization.h
  • JS_InitReflect is now implicit
  • JS_AddWeakPointerCallback is replaced with JS_AddWeakPointerZoneGroupCallback and JS_AddWeakPointerCompartmentCallback
  • JS_RemoveWeakPointerCallback is replaced with JS_RemoveWeakPointerZoneGroupCallback and JS_RemoveWeakPointerCompartmentCallback

API changes

JavaScript shell changes

Detail added/removed methods here...

Known Issues

Detail any known issues here...

Future Direction

JSContext and JSRuntime are merging. (JSContext will be the only thing visible from within the API, there will be just one per runtime, and inheriting from JSRuntime.)

SpiderMonkey embedders should be aware that

  • Mozilla has no plans to keep the JSAPI stable for embedders. We have instead chosen to concentrate on overall performance and accuracy as our primary concerns.

Release Notes Errata

Feel free to fix any problems you spot, directly in the text above -- this is a Wiki!

Document Tags and Contributors

 Contributors to this page: bunnybooboo, sphink, evilpie
 Last updated by: bunnybooboo,