These release notes are an incomplete draft and were initially seeded from the (now-defunct) 1.8.8 release notes, which were themselves seeded from the 1.8.5 release notes, so lots of the information here isn't actually new to SpiderMonkey 17.
— 25 March 2013
SpiderMonkey 17 is supported on all the platforms where Firefox 17 runs.
The following features in earlier versions of SpiderMonkey have been dropped.
JSRESOLVE_WITHresolve flags (passed to JSClass.resolve when
JSClass.flagscontains JSCLASS_NEW_RESOLVE) have been removed.
SpiderMonkey 17 is not binary-compatible with previous releases, nor is it source-code compatible. Many JSAPI types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. Applications will need significant changes, but most of those changes will be detected by the C/C++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. Here is a list of the most significant changes.
- A significant number of
typedefs of built-in types, or of types which are now standardized, have been removed.
These and other changes are explained in detail below.
Many types have been removed from the JSAPI and replaced with simpler alternatives. Including
jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code.
||Replacement type||Provided by|
The fixed-size integer types are defined in one of the following ways:
- If the environment variable
MOZ_CUSTOM_STDINT_His set, that file will be included to provide definitions for these types. The file must conform to the standard C99
<stdint.h>header interface in all respects, providing all that header's types and macro definitions. (The msstdint project includes an implementation of this header for Microsoft Visual Studio which demonstrates what the C99 interface looks like.)
- Otherwise, if the compiler doesn't provide a usable
<stdint.h>header, a custom implementation shipped with the SpiderMonkey source is used. Currently only versions of Visual Studio prior to 2010 (also known as version 10) are known to be deficient in this manner, so the custom implementation (which is compatible with the one shipped in Visual Studio 2010 and later) is only invoked for those compilers.
The environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of Visual Studio. In the long run we anticipate removing the environment variable-based overriding when we drop support for versions of Visual Studio prior to 2010. In the meantime
MOZ_CUSTOM_STDINT_H is intended to function as a bridge to always using the standard header.
For more information on the fixed-size integer types changes, see this blog post.
...list and link to new APIs here...
While JSAPI remains a C API, the engine is now implemented in C++. Some C++ helpers have been introduced into the API, to help embedders writing C++ projects. Please note that SpiderMonkey reserves the JS:: namespace for itself.
...list new C++ helpers here...
...list obsolete methods/structs/APIs here...
- JS_GET_CLASS (use
JS_Newinstead, or use this reimplementation as a short-term fix)
- JS_NewCompartmentAndGlobalObject (Use JS_NewGlobalObject instead.)
- JSVAL_IS_OBJECT() (use !JSVAL_IS_PRIMITIVE(v) to detect objects and JSVAL_IS_NULL(v) to detect null).
- JSCLASS_NEW_RESOLVE_GETS_START flag
- JSCLASS_MARK_IS_TRACE flag
Break out and discuss all API changes here...
JSClass Prototype has changed
A number of optional members have been removed from the JSCLass Prototype.
JSClass Callback changes
Many of the JSClass callbacks such as
JSPropertyOp, have a type change on their arguments to
JSHandleMutableObject etc. Atleast for the C API this wraps an extra pointer around these objects, so you would cast the argument to
JSObject**, in the callback function.
JSContext* parameters to many methods
JS_GetClass method now takes only a
JSObject*, where previously it also required a
JSContext* in threadsafe builds. (The JS_GET_CLASS macro abstracting away this difference has accordingly been removed.)
Garbage Collection functions now take runtime argument
Most garbage collection functions now take a runtime argument instead of a context. The one exception to this is
JS_MaybeGC which still takes a context as argument.
Detail added/removed methods here...
Detail any known issues here...
SpiderMonkey embedders should also be aware that
- Mozilla has no plans to keep the JSAPI, nor the JSDBGAPI stable for embedders. We have chosen to concentrate on performance and correctness as primary concerns instead.
- The team is considering the removal of TinyIDs
- JS_THREADSAFE is going away, with future versions supporting only thread-safe builds
- A new debugging API is on the way to replace JSD.
- In the future every API is going to take Handles instead of raw pointers. Exact Stack Rooting is requirement for a (moving) Generational Garbage Collector.
This is a list of changes which need to be made to the release notes ASAP. Feel free to fix any problems you spot -- this is a Wiki!
- Don't add anything here -- this is for after the release notes are completed. :-)