Closed Bug 1635839 Opened 2 months ago Closed 1 month ago

Initial Private Fields Functionality

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: mgaudet, Assigned: mgaudet)

References

(Blocks 1 open bug)

Details

Attachments

(5 files, 5 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Thanks to André Bargull we have the initial seeds of a private fields implementation. Almost all of which is in a landable state.

I'm going to use this bug to upload the patches he provided (some of which I have made small tweaks to) and we'll get them landed. After that we can make progress on getting the rest done.

(note: this isn't feature complete, but is a skeleton upon which we will build)

Matthew Gaudetu- Added illegal-in-class-context to ensure that field syntax
only works inside of classes if fields are enabled.

Depends on D74106

Matthew Gaudet: Add test for double declaration of private name

Depends on D74108

Matthew Gaudet - Added comment

Depends on D74109

Matthew Gaudet: Use NoteUsedName inside of fieldInitializerOpt rather than allocating a new PrivateName node.

Attachment #9146250 - Attachment is obsolete: true
Attachment #9146908 - Attachment is obsolete: true

I'm going to start reworking how this patch stack will land, so I'm resummarying this, and will land parts 1-5 under this. Subsequent parts will come in another bug.

Summary: Initial Private Fields Prototype → Initial Private Fields Functionality
Pushed by mgaudet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e90011b2f167
Part 1: Add PrivateName Symbol code. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/0f28dc01529f
Part 2: Add a temporary testing function to create PrivateName symbols. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/9cae1becce65
Part 3: Skip PrivateName symbols in iteration code. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/593a8860ad50
Part 4: Add an option for private class fields, disabled by default r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/a9ccc860736e
Part 5: Enable the private name tokenizer code. r=jorendorff

Backed out for failures on not-iterable.js

backout: https://hg.mozilla.org/integration/autoland/rev/023c0fdf6679bde4ba0772ff5c060c371e2f268e

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&revision=a9ccc860736e5349b63eef46168bea6b9ff59018&searchStr=jsreftest&selectedTaskRun=clzMJ78_RsWFuGMyRNW3hA-0

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=304723463&repo=autoland&lineNumber=5634

[task 2020-06-02T13:35:14.385Z] 13:35:14 INFO - REFTEST TEST-START | js/src/tests/non262/PrivateName/not-iterable.js
[task 2020-06-02T13:35:14.385Z] 13:35:14 INFO - REFTEST TEST-LOAD | file:///Z:/task_1591104203/build/tests/jsreftest/tests/js/src/tests/jsreftest.html?test=non262/PrivateName/not-iterable.js | 602 / 12479 (4%)
[task 2020-06-02T13:35:14.444Z] 13:35:14 INFO - TEST-INFO | FAILED! TypeError: can't convert symbol to string
[task 2020-06-02T13:35:14.444Z] 13:35:14 INFO - JavaScript error: file:///Z:/task_1591104203/build/tests/jsreftest/tests/js/src/tests/non262/PrivateName/not-iterable.js, line 3: TypeError: can't convert symbol to string
[task 2020-06-02T13:35:14.472Z] 13:35:14 INFO - REFTEST TEST-UNEXPECTED-FAIL | js/src/tests/non262/PrivateName/not-iterable.js | Unknown file:///Z:/task_1591104203/build/tests/jsreftest/tests/js/src/tests/non262/PrivateName/not-iterable.js:3: TypeError: can't convert symbol to string item 1
[task 2020-06-02T13:35:14.473Z] 13:35:14 INFO - REFTEST INFO | Saved log: START file:///Z:/task_1591104203/build/tests/jsreftest/tests/js/src/tests/jsreftest.html?test=non262/PrivateName/not-iterable.js
[task 2020-06-02T13:35:14.473Z] 13:35:14 INFO - REFTEST INFO | Saved log: [CONTENT] OnDocumentLoad triggering AfterOnLoadScripts

Flags: needinfo?(mgaudet)

Comment on attachment 9146247 [details]
Bug 1635839 - Part 6: Private fields in non-derived classes. r?jorendorff!,anba!

Revision D74107 was moved to bug 1642476. Setting attachment 9146247 [details] to obsolete.

Attachment #9146247 - Attachment is obsolete: true

Comment on attachment 9146248 [details]
Bug 1635839 - Part 7: Add a separate scope for class body bindings. r?jorendorff

Revision D74108 was moved to bug 1642476. Setting attachment 9146248 [details] to obsolete.

Attachment #9146248 - Attachment is obsolete: true

Comment on attachment 9146249 [details]
Bug 1635839 - Part 8: Install bindings for private names. r?jorendorff!,anba!

Revision D74109 was moved to bug 1642476. Setting attachment 9146249 [details] to obsolete.

Attachment #9146249 - Attachment is obsolete: true
Flags: needinfo?(mgaudet)
Pushed by mgaudet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0880c9f68210
Part 1: Add PrivateName Symbol code. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/e739f15aeaf8
Part 2: Add a temporary testing function to create PrivateName symbols. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/2b34ab462221
Part 3: Skip PrivateName symbols in iteration code. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/851ee4729a31
Part 4: Add an option for private class fields, disabled by default r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/480ec262bae2
Part 5: Enable the private name tokenizer code. r=jorendorff
You need to log in before you can comment on or make changes to this bug.