JavaScript Language Feature Checklist
So you’re working on a new JavaScript feature in SpiderMonkey: Congratulations! Here’s a set of checklists and guidelines to help you on your way.
High Level Feature Ship Checklist.
(Note: Some of these pieces can happen in parallel, so it’s not necessary to work directly top-down)
☐ File a meta bug for the feature (for TC39 proposals, when it reaches Stage 2.7).
☐ Leave a needinfo on the meta bug for the DevTools team to check if work is required on their side for this feature. File a DevTools bug if needed.
☐ Send an
Intent to prototypeemail todev-platform. This is part of the Exposure Guidelines process. We historically haven’t been amazing at sending intent-to-prototype emails, but we can always get better.☐ Stage 2 or earlier proposals should be developed under compile time guards, disabled by default. Please add a configuration to taskcluster to ensure that the code compiles and the tests pass. Here is a recent example.
☐ Create a preference for the feature in
modules/libpref/init/StaticPrefList.yamland a command line option injs/src/shell/js.cpp.☐ Implement the Feature.
☐ Land feature disabled by pref.
☐ Import the test262 test cases for the feature, or enable them if they’re already imported. (See js/src/tests/README.txt for guidance)
☐ Add the
fuzzing:neededlabel to the proposal epic in the FFXP project in JIRA to request fuzzing for the feature.☐ If the feature introduces a new syntax, it may require a lot of work in the fuzzing engine to support it. Notify the fuzzing team early with the details.
☐ File a bug to ship the feature. Set the
dev-doc-neededflag so that the MDN team is aware that documentation will be needed.☐ Send an
Intent to shipemail todev-platform. This is also part of the Exposure Guidelines process.If we didn’t previously send an
Intent to prototype, use theIntent to prototype and shiptemplate instead.If the feature was implemented by a external contributor, please thank them in th email.
☐ Ping the fuzzing team to make sure sufficient fuzzing has occurred.
☐ Ship the feature:
☐ Default the preference to true.
☐ Double check for any code that is currently
NIGHTLY_BUILDthat should now be built unconditionally, e.g. injs/src/vm/JSObject.cpp. You may want to run a central as beta simulation to make sure you’ve caught any lingeringNIGHTLY_BUILDparts.☐ Update
js/xpconnect/tests/chrome/test_xrayToJS.xhtmlfor any changes to existing global objects. This is a mochitest, you need to runmach test js/xpconnect/tests/chrome/test_xrayToJS.xhtml.☐ For new globals, the following tests also need updates:
dom/serviceworkers/test/test_serviceworker_interfaces.js,tests/mochitest/general/test_interfaces.js, anddom/workers/test/test_worker_interfaces.js. These are mochitests, you need to run, e.g.mach test dom/serviceworkers/test/test_serviceworker_interfaces.html.☐ Once the feature is shipped, request a release note using the
relnote-firefoxflag in Bugzilla.
☐ Open a followup bug to later remove the preference.
Supplemental Checklists
Shipping Consideration Checklist
☐ If it seems possible that the feature will cause webcompat issues, consider shipping
NIGHTLY_ONLYfor a cycle or two, to use nightly as an attempt to shake out potential webcompat issues. Please setdev-doc-neededon the bug, so that MDN team can document that the feature is available in Nightly.
Web Platform Integration Checklist
Sometimes Complexity of the web-platform leaks into JS Feature work
☐ Ensure the appropriate web-platform tests exist, and are being run.
☐ Is your feature correctly enabled inside of Workers? (They have different option set than main thread, and it’s easy to forget them!) You may want to write a mochitest.
Syntax Features Checklist
☐ Does
Reflect.parsecorrectly parse and return results for your new syntax?Reflect.parsetests are interesting as well, because they can be written for new syntax before bytecode emission is done.☐ Are the locations correct for the new syntax entries in the parse tree?
☐ Are your errors emitted with sensible location info?
Testing Consideration Checklist
There’s lots of complexity in SpiderMonkey that isn’t always captured by the specification, so the below is some useful guidance to behaviour to pay attention to that may not be tested by a feature’s test262 tests
☐ How does your feature interact with multiple compartments? What happens if references happen across compartments, or if
thisis aCrossCompartmentWrapper?☐ Are your error messages being emitted in the correct realm, with the correct prototype?
☐ If async functions or promises are involved, are user-code objects resolved? If so, does the feature correctly handle the
.thenproperty behaviour of promise resolution?☐ Have you written some OOM tests for your feature to ensure your OOM handling is correct?
Web Platform Testing Considerations
☐ Does the feature have to handle exotic objects specially? Consider what happens when your feature interacts with the very exotic objects on the web platform, such as
WindowProxy,Location(cross-origin objects).☐ What happens when your feature interacts with X-rays?