Add a protoClass argument to JS_InitClass
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox110 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
Attachments
(10 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
The pull request on GitHub here made me realize we should change this API to not use the same JSClass* argument for the constructor name and the prototype's JSClass.
Callers can then pass nullptr for protoClass to get a PlainObject prototype, which is preferable nowadays.
This also lets us use plain objects for most debugger object prototypes, which simplifies the code a bit because we can then get rid of the isInstance methods.
| Assignee | ||
Comment 1•2 years ago
|
||
This decouples the two uses of the passed JSClass, to make it easier to use
JS_InitClass when you don't want to use the same JSClass for the prototype
and the instance objects.
Later patches will change most of the callers to pass nullptr for protoClass.
Also adds documentation for JS_InitClass.
| Assignee | ||
Comment 2•2 years ago
|
||
This matches newer language features and lets us simplify the code a bit.
Depends on D165796
| Assignee | ||
Comment 3•2 years ago
|
||
Depends on D165797
| Assignee | ||
Comment 4•2 years ago
|
||
Depends on D165798
| Assignee | ||
Comment 5•2 years ago
|
||
Depends on D165799
| Assignee | ||
Comment 6•2 years ago
|
||
Depends on D165800
| Assignee | ||
Comment 7•2 years ago
|
||
Depends on D165801
| Assignee | ||
Comment 8•2 years ago
|
||
The test doesn't use AddPropertyTester from JS.
Depends on D165802
| Assignee | ||
Comment 9•2 years ago
|
||
Depends on D165803
| Assignee | ||
Comment 10•2 years ago
|
||
The Debugger.prototype object only needs slots for the proto objects.
Depends on D165804
Comment 11•2 years ago
|
||
Hello Jandem
In your patch it seems that clasp parameter has no more usage instead of clasp->name to give a name to the property that will be created, thus is it sane to replace it by a plain char const * and rename it to some think more accurate ?
Best regards
| Assignee | ||
Comment 12•2 years ago
|
||
(In reply to gschwind from comment #11)
In your patch it seems that clasp parameter has no more usage instead of clasp->name to give a name to the property that will be created, thus is it sane to replace it by a plain char const * and rename it to some think more accurate ?
It crossed my mind earlier today but I decided to leave the clasp argument alone. However, thinking about it again, it probably make sense to change this at the same time as it does make the API strictly more powerful.
Updated•2 years ago
|
| Assignee | ||
Comment 13•2 years ago
|
||
I updated the patch stack to replace clasp with name. I think it's a nice improvement.
Comment 14•2 years ago
|
||
Comment 15•2 years ago
|
||
Backed out 10 changesets (Bug 1808171) for causing failures in test_HeapSnapshot_takeCensus_06.js CLOSED TREE
Log: https://treeherder.mozilla.org/logviewer?job_id=401211980&repo=autoland&lineNumber=4033
Backout: https://hg.mozilla.org/integration/autoland/rev/57bed80129e37851a13261bfa4a1b58fe0d0d50d
| Assignee | ||
Comment 16•2 years ago
•
|
||
I added the xpcshell-test tasks on Try but apparently the same X1 task on Try did not run this test :/
Maybe a side-effect of ./mach try auto like bug 1714984. That's unfortunate.
| Assignee | ||
Updated•2 years ago
|
Comment 17•2 years ago
|
||
Updated•2 years ago
|
Comment 18•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/15e1e69037e3
https://hg.mozilla.org/mozilla-central/rev/ed74b518c904
https://hg.mozilla.org/mozilla-central/rev/c3106692cf15
https://hg.mozilla.org/mozilla-central/rev/7fa4a642d8cc
https://hg.mozilla.org/mozilla-central/rev/157ca8f34f3d
https://hg.mozilla.org/mozilla-central/rev/62adab0ec9eb
https://hg.mozilla.org/mozilla-central/rev/a729cd4de5c4
https://hg.mozilla.org/mozilla-central/rev/54fbbeaf8477
https://hg.mozilla.org/mozilla-central/rev/888062ee7777
https://hg.mozilla.org/mozilla-central/rev/7527c113748d
Description
•