Bug 1922523 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This bug is about adding a placeholder implementation for the `Math.sumPrecise` proposal. The steps to do this are:
1) Make sure that you are able to build SpiderMonkey and run the existing tests. There are instructions here. You want to run the jstests, using this command `./mach jstests`.
2) In the [jsmath.cpp](https://searchfox.org/mozilla-central/source/js/src/jsmath.cpp#943) add a placeholder method for sumPrecise. We use NIGHTLY_BUILD so this will only be built for Nightly, and will not be available in release. Returning false means this method will fail all the time for now.
```
#ifdef NIGHTLY_BUILD
static bool math_sumprecise(JSContext* cx, unsigned argc, Value* vp) {
  return false;
}
+#endif
```
3) We also need to add it to the [list of methods](https://searchfox.org/mozilla-central/source/js/src/jsmath.cpp#1097) on the Math object, right at the end of the list. There's an example of how to do this [in this patch](https://phabricator.services.mozilla.com/D203416).
4) The final step is to [remove it from the Math object](https://searchfox.org/mozilla-central/source/js/src/vm/JSObject.cpp#2303) when the pref is not enabled. There's an example of how to do this [in this patch](https://phabricator.services.mozilla.com/D203416) as well.
5) Make sure you can still build and run the tests.
6) Once the tests all pass for you, you can commit your changes. Your commit message should look like: `Bug X - Add placeholder for Math.sumPrecise proposal; r=dminor!`, where X is the number for this bug.
7) Once you have your changes committed, request review. There are instructions on using [phabricator](https://firefox-source-docs.mozilla.org/devtools/contributing/code-reviews-setup.html) and on [getting reviews](https://firefox-source-docs.mozilla.org/contributing/reviews.html).
This bug is about adding a placeholder implementation for the `Math.sumPrecise` proposal. The steps to do this are:
1) Make sure that you are able to build SpiderMonkey and run the existing tests. There are instructions here. You want to run the jstests, using this command `./mach jstests`.
2) In the [jsmath.cpp](https://searchfox.org/mozilla-central/source/js/src/jsmath.cpp#943) add a placeholder method for sumPrecise. We use NIGHTLY_BUILD so this will only be built for Nightly, and will not be available in release. Returning false means this method will fail all the time for now.
```
#ifdef NIGHTLY_BUILD
static bool math_sumprecise(JSContext* cx, unsigned argc, Value* vp) {
  return false;
}
#endif
```
3) We also need to add it to the [list of methods](https://searchfox.org/mozilla-central/source/js/src/jsmath.cpp#1097) on the Math object, right at the end of the list. There's an example of how to do this [in this patch](https://phabricator.services.mozilla.com/D203416).
4) The final step is to [remove it from the Math object](https://searchfox.org/mozilla-central/source/js/src/vm/JSObject.cpp#2303) when the pref is not enabled. There's an example of how to do this [in this patch](https://phabricator.services.mozilla.com/D203416) as well.
5) Make sure you can still build and run the tests.
6) Once the tests all pass for you, you can commit your changes. Your commit message should look like: `Bug X - Add placeholder for Math.sumPrecise proposal; r=dminor!`, where X is the number for this bug.
7) Once you have your changes committed, request review. There are instructions on using [phabricator](https://firefox-source-docs.mozilla.org/devtools/contributing/code-reviews-setup.html) and on [getting reviews](https://firefox-source-docs.mozilla.org/contributing/reviews.html).

Back to Bug 1922523 Comment 0