Closed Bug 409298 Opened 17 years ago Closed 17 years ago

"ASSERTION: toString failed us" with XPCSafeJSObjectWrapper.prototype

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: mrbkap)

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Loading the testcase triggers: ###!!! ASSERTION: toString failed us: 'type != JSTYPE_STRING', file /Users/jruderman/trunk/mozilla/js/src/xpconnect/src/XPCSafeJSObjectWrapper.cpp, line 646
Attached file testcase
Attached patch FixesSplinter Review
There were two problems: * I didn't realize that we seal XPCSafeJSObjectWrapper.prototype, so resolving toString late, like we do doesn't work. To fix this, I resolve it before we cut off its parent and seal it. * I moved the resolution of toString to after the prototype and security checks in XPC_SJOW_NewResolve to avoid unknown badness.
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #294118 - Flags: superreview?(jst)
Attachment #294118 - Flags: review?(jst)
Attachment #294118 - Flags: superreview?(jst)
Attachment #294118 - Flags: superreview+
Attachment #294118 - Flags: review?(jst)
Attachment #294118 - Flags: review+
Comment on attachment 294118 [details] [diff] [review] Fixes Easy followup to make SJOW prototypes happier.
Attachment #294118 - Flags: approval1.9?
Comment on attachment 294118 [details] [diff] [review] Fixes a=beltzner for 1.9
Attachment #294118 - Flags: approval1.9? → approval1.9+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Attached patch Add a mochitestSplinter Review
I decided to make test_xow.html be test_wrappers.html and add a couple of XPCSafeJSObjectWrapper to that file. I also noticed that I'd somehow managed to add a duplicate dirs directive to the makefile in xpconnect/tests, causing rules.mk to spit out a warning.
Attachment #294252 - Flags: review?(bzbarsky)
Comment on attachment 294252 [details] [diff] [review] Add a mochitest Looks reasonable
Attachment #294252 - Flags: review?(bzbarsky) → review+
Mochitest 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: