Open
Bug 656043
Opened 14 years ago
Updated 2 years ago
Un-gunk js_InitClass/JS_InitClass after bug 655192 eliminates the reasons for that gunk
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: Waldo, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(3 files)
(deleted),
patch
|
jorendorff
:
review-
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
After bug 655192, js_InitClass is only relevant to JS_InitClass. So it should be inlined into JS_InitClass, and the parts of it that are no longer necessary for standard-class initialization should be removed.
This builds on bug 655192, of course.
Reporter | ||
Comment 1•14 years ago
|
||
Attachment #531359 -
Flags: review?(jorendorff)
Reporter | ||
Comment 2•14 years ago
|
||
Attachment #531361 -
Flags: review?(jorendorff)
Reporter | ||
Comment 3•14 years ago
|
||
Attachment #531362 -
Flags: review?(jorendorff)
Comment 4•13 years ago
|
||
Comment on attachment 531359 [details] [diff] [review]
Inline js_InitClass (and a couple functions called only by it) into JS_InitClass
Review of attachment 531359 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the one concern below addressed.
::: js/src/jsapi.cpp
@@ +2948,5 @@
> + * be &js_FunctionClass (we could break compatibility easily). But fixing
> + * (3) is not enough without addressing the bootstrapping dependency on (1)
> + * and (2).
> + */
> + JSObject *proto = NewNonFunction<WithProto::Given>(cx, clasp, protoProto, obj);
Changing NewObject to NewNonFunction is fine, but changinge from WithProto::Class to
WithProto::Given seems like it will change the behavior. The API docs don't say what's supposed to happen if the proto_proto argument is NULL; WithProto::Class means we look it up in the global, and not finding it (since we haven't defined it yet) we would default to Object.prototype ...right? With your new code, the new prototype actually has no prototype. I imagine that will break something somewhere.
r=me if you decide to either
a) revert to WithProto::Class behavior, as in tm tip
b) keep the change to WithProto::Given, but right before that do something like
if (protoProto == NULL)
protoProto = obj->getGlobal()->getObjectPrototype();
and update the MDN doc to specify this behavior.
A jsapi-test wouldn't hurt either!
Attachment #531359 -
Flags: review?(jorendorff) → review+
Comment 5•13 years ago
|
||
Comment on attachment 531359 [details] [diff] [review]
Inline js_InitClass (and a couple functions called only by it) into JS_InitClass
Switching to r- just to avoid confusion.
This patch needs to follow additional work in bug 655192; it's not ripe yet.
Attachment #531359 -
Flags: review+ → review-
Comment 6•13 years ago
|
||
Comment on attachment 531361 [details] [diff] [review]
Remove unused JSCLASS_* code from JS_InitClass, also much of the code to handle cached prototypes
Clearing review flags for now, since this stuff isn't ripe yet.
Attachment #531361 -
Flags: review?(jorendorff)
Updated•13 years ago
|
Attachment #531362 -
Flags: review?(jorendorff)
Comment 7•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: jwalden → nobody
Status: ASSIGNED → NEW
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•