Closed Bug 1923146 Opened 1 year ago Closed 1 year ago

[Outreachy] Add placeholder implementation for Iterator.Zip

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: dminor, Assigned: moyotawanda)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

This bug is about adding a placeholder implementation for the Iterator.Zip method of the joint iteration 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 Iterator.js add a placeholder method for IteratorZip. 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
/**
 * Iterator.zip ( iterables [, options] )
 *
 * https://tc39.es/proposal-joint-iteration/#sec-iterator.zip
 */
function IteratorZip(predicate) {
  return false;
}
#endif
  1. Add the new function as a static method on Iterators. Please use #ifndef NIGHTLY_BUILD / #endif here as well.
  2. You can check that your new method is available in the shell, e.g. print(Iterator.zip) from the JavaScript shell.
  3. The final step is to remove it from the Iterator object when the pref for joint iteration is not enabled. There's an example of how to do this in this patch, you'll want to do a check on JSProto_Iterator. Note that you'll have to add zip to CommonPropertyNames.h.
  4. Make sure you can still build and run the tests.
  5. Once the tests all pass for you, you can commit your changes. Your commit message should look like: Bug X - Add placeholder for Iterator.zip; r=dminor!, where X is the number for this bug.
  6. Once you have your changes committed, request review. There are instructions on using phabricator and on getting reviews.
Blocks: 1923148

:dminor, I am working on it.

Flags: needinfo?(dminor)
Assignee: nobody → syedbarimanjan
Flags: needinfo?(dminor)

Let's save this one for a new contributor, I know that you are capable of doing this one already :)

Assignee: syedbarimanjan → nobody
Assignee: nobody → moyotawanda

I'd like to work on this issue.

(In reply to Serah Nderi from comment #3)

I'd like to work on this issue.

Hi Serah, already working on this issue

Severity: -- → N/A
Priority: -- → P3

Hi Tawanda, your changes are good, but need to be rebased on the latest mozilla-central because of merge conflicts (https://lando.services.mozilla.com/D224921/) before I can land this.

Flags: needinfo?(moyotawanda)

Thanks, rebasing

Flags: needinfo?(moyotawanda)

(In reply to Dan Minor [:dminor] from comment #6)

Hi Tawanda, your changes are good, but need to be rebased on the latest mozilla-central because of merge conflicts (https://lando.services.mozilla.com/D224921/) before I can land this.

I have pushed another revision/diff , is that sufficient ?

Pushed by dminor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a247701650bc Add placeholder for Iterator.zip; r=dminor

:dminor, This is removing the math_sumprecise conditional in the JSObject.cpp file.

Flags: needinfo?(dminor)

Oops, I missed that, and it's already landed. I'll open a new bug.

Flags: needinfo?(dminor)
Regressions: 1923710
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch

Comment on attachment 9430009 [details]
Bug 1923146 - Re-add sumPrecise check. r=syedbarimanjan

Revision D225134 was moved to bug 1923710. Setting attachment 9430009 [details] to obsolete.

Attachment #9430009 - Attachment is obsolete: true
Attachment #9430008 - Attachment is obsolete: true
Attachment #9430005 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: