Open Bug 564208 Opened 14 years ago Updated 2 years ago

After screwing with __proto__, iterating throws "Illegal operation on WrappedNative prototype object"

Categories

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

x86
macOS
defect

Tracking

()

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

Attached file testcase
[Exception... "Illegal operation on WrappedNative prototype object"  nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"  location: "JS frame :: file:///Users/jruderman/Desktop/e.html :: <TOP_LEVEL> :: line 8"  data: no]

It's unusual for "for (p in obj) { }" to throw, so I'm guessing this is a bug and not intended behavior.
Attached patch Fix (obsolete) — Splinter Review
A for-each loop on the object will still throw, but in general, we should avoid calling getters while enumerating to avoid these sorts of exceptions.
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #450447 - Flags: review?(jst)
Attachment #450447 - Flags: review?(jst) → review+
Comment on attachment 450447 [details] [diff] [review]
Fix

This patch is no good. We actually use the value of len_val, so we need to get it. This is probably not worth fixing, given that.
Attachment #450447 - Attachment is obsolete: true
Attachment #450447 - Flags: review+ → review-
Assignee: mrbkap → nobody
Resetting to NEW. Set back to ASSIGNED with an assignee if you're actively working on this.
Status: ASSIGNED → NEW
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: