Closed
Bug 1107496
Opened 10 years ago
Closed 10 years ago
Add PlainObject subclass
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: bhackett1024, Assigned: bhackett1024)
References
Details
Attachments
(1 file)
174.48 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
There are a lot of subclasses of JSObject and NativeObject for the various kinds of objects that can be created, but there isn't one for the ordinary objects created using '{}' object literals, 'new Foo()', 'Object.create()', etc. The clasp for these objects is stored on JSObject itself, which leads to lots of weird code like 'obj->is<JSObject>()', makes it hard to create these objects in an elegant way, is error prone (a class_ left out on a subclass will cause references to resolve to JSObject::class_, which is never what we want to happen), and leads to the code being underspecified (we have to use JSObject or NativeObject to refer to these objects). The attached patch adds a PlainObject subclass to NativeObject to refer to these objects. I don't know if there's a better name to use here, but PlainObject seemed nice to easily distinguish these from the JSObject/NativeObject superclasses. This patch also cleans up some object creation APIs and replaces a lot of uses of NativeObject or JSObject with specific subclasses, and fixes a TypedObject bug where a couple functions ended up being named 'Object' due to the class resolving thing above.
Attachment #8532030 -
Flags: review?(luke)
Comment 1•10 years ago
|
||
Comment on attachment 8532030 [details] [diff] [review] patch Review of attachment 8532030 [details] [diff] [review]: ----------------------------------------------------------------- Nice
Attachment #8532030 -
Flags: review?(luke) → review+
Assignee | ||
Comment 2•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/64ec5c15d182
Comment 3•10 years ago
|
||
Backed out for SM(ggc) failures. https://hg.mozilla.org/integration/mozilla-inbound/rev/3e1e87355f8f https://treeherder.mozilla.org/logviewer.html#?job_id=4391254&repo=mozilla-inbound
Assignee | ||
Comment 4•10 years ago
|
||
Hmm, the try run I did (acf43bc57a51) never even ran SM(ggc). https://hg.mozilla.org/integration/mozilla-inbound/rev/516d97ff2d4d
Comment 5•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/516d97ff2d4d
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•