Closed
Bug 56206
Opened 24 years ago
Closed 24 years ago
superglobal-based JS embeddings burned by fun_resolve
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla0.8
People
(Reporter: brendan, Assigned: brendan)
Details
(Keywords: js1.5)
Attachments
(2 files)
2.42 KB,
patch
|
Details | Diff | Splinter Review | |
2.28 KB,
patch
|
Details | Diff | Splinter Review |
because fun_resolve uses js_NewObject(cx, &js_ObjectClass, proto, NULL) where
proto is the "parent proto" or superglobal's function.prototype property value,
and NULL as the 4th arg causes js_NewObject to default the new object's parent
from proto.constructor.__parent__ (which is the superglobal).
You end up with cloned function objects have .prototypes that are proto-clones
of the original function object's .prototype, but the child .prototypes have as
their __parent__ the superglobal! Bad parenting here can lead to other bugs and
confusion later.
Patch coming up.
/be
Assignee | ||
Updated•24 years ago
|
Severity: normal → major
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
I can't write today to save my ass. Sorry for the mangled syntax there! Gimme
r= and a= love, ok?
/be
Assignee | ||
Comment 3•24 years ago
|
||
Better patch coming up. No need for separate JS_SetPrototype given non-null
parent arg to js_NewObject.
/be
Keywords: js1.5
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Comment 5•24 years ago
|
||
Anyone have time to study this patch? Ask me questions!
/be
Assignee | ||
Comment 6•24 years ago
|
||
Adding r= buddies, soliciting r= and a=.
/be
Target Milestone: mozilla0.9 → mozilla0.8
Assignee | ||
Comment 7•24 years ago
|
||
High priority for me, want to get this patch in soon.
/be
Priority: P3 → P1
Assignee | ||
Comment 8•24 years ago
|
||
Meow?
/be
Comment 9•24 years ago
|
||
Wow, I want to use 'ad perniciem' in my comments.
Is there an essay somewhere on just how superglobals work?
r=mccabe.
Assignee | ||
Comment 10•24 years ago
|
||
Superglobals are mainly documented by newsgroup postings, such as
http://x53.deja.com/%5BST_rn=ps%5D/getdoc.xp?AN=541478652&CONTEXT=975966602.402128927&hitnum=8
(That flagrant latinism was from shaver. ;-) Thanks for the r= -- on to jband.
/be
Assignee | ||
Updated•24 years ago
|
Keywords: mozilla0.8
Comment 11•24 years ago
|
||
sr=jband
Assignee | ||
Comment 12•24 years ago
|
||
Fixed.
/be
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
Keywords: mozilla0.8
You need to log in
before you can comment on or make changes to this bug.
Description
•