Closed Bug 327571 Opened 19 years ago Closed 19 years ago

"ASSERTION: nsDOMClassInfo::GetProperty Don't call me!" when getting an input element by name through the prototype of another dom node

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: jruderman, Assigned: mrbkap)

Details

(Keywords: assertion, testcase, Whiteboard: [patch])

Attachments

(2 files)

###!!! ASSERTION: nsDOMClassInfo::GetProperty Don't call me!: 'Error', file /Users/admin/trunk/mozilla/dom/src/base/nsDOMClassInfo.cpp, line 3327
Attached file testcase
I've been hitting this assertion a lot when playing with bug 326633, so I'd appreciate a fix.
jst and I talked this over and there's no easy and performant way to fix this bug for real. Currently, XPCWrappedNative uses a different class getter based on whether or not a given class has the flag WantGetProperty(). This is to avoid the test for whether or not |this| has that flag. Unfortunately, mutable prototypes make this optimization violate the assertions in nsDOMClassInfo. Fixing this in any way in XPConnect will likely break other places that don't depend on this behavior (i.e., any such fix would not be specific enough) and would also hurt performance in a case where I don't think we care _too_ much what we do, as long as we don't crash. I have a patch to turn the assertions into warnings, since this seems like a valid case that will hit them.
OS: MacOS X → All
Priority: -- → P3
Hardware: Macintosh → All
Whiteboard: [patch]
Target Milestone: --- → mozilla1.9alpha
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #212665 - Flags: superreview?(brendan)
Attachment #212665 - Flags: review?(jst)
Comment on attachment 212665 [details] [diff] [review] Make this case not assert rs=me. We need a bug to make __proto__ readonly as well as permanent for DOM stuff, if not for XPConnect stuff. /be
Attachment #212665 - Flags: superreview?(brendan) → superreview+
Comment on attachment 212665 [details] [diff] [review] Make this case not assert r=jst People rely on changing DOM object prototypes, some of the JS libraries out there that implement outerHTML and other IE:ism's do just that...
Attachment #212665 - Flags: review?(jst) → review+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Do they really set a new __proto__ to do that? Don't they just set properties on the existing prototypes.
(In reply to comment #8) > Do they really set a new __proto__ to do that? Don't they just set properties > on the existing prototypes. > Sorry, I was replying based on me misunderstanding something mrbkap told me in person. No, generally people add/remove from the existing protos, I've very rarely, if ever, seen real code out there that replaces a DOM object's __proto__ property.
I can verify that this is fixed on Mac, but has a bug been filed based on comment 5?
Crashtest checked in.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: