Closed
Bug 307005
Opened 19 years ago
Closed 19 years ago
NS_ERROR_UNEXPECTED when using evalInSandbox with XPCNativeWrapper
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: boogs, Assigned: mrbkap)
References
()
Details
(Keywords: fixed1.8, testcase)
Attachments
(2 files)
341 bytes,
text/html
|
Details | |
4.87 KB,
patch
|
jst
:
review+
brendan
:
superreview+
asa
:
approval1.8b5+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+
If you set the __proto__ of a sandbox being used with evalInSandbox to an
XPCNativeWrapper object, it doesn't work and you only get a generic error
message. It should work the same as it does without the XPCNativeWrapper so long
as the methods being called actually exist, and it should throw a descriptive
'method not defined' error with line number if they do not.
Reproducible: Always
Steps to Reproduce:
1. Run example code.
Actual Results:
JS console says:
Error: uncaught exception: [Exception... "Unexpected error" nsresult:
"0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame ::
file:///C:/Documents%20and%20Settings/aa/Desktop/evalInSandbox.html ::
<TOP_LEVEL> :: line 6" data: no]
Expected Results:
It should show an alert box that says 'inside eval'.
If you uncomment line 5 it works correctly.
Updated•19 years ago
|
Assignee: nobody → dbradley
Component: General → XPConnect
Keywords: testcase
Product: Firefox → Core
QA Contact: general → pschwartau
Version: unspecified → Trunk
Comment 1•19 years ago
|
||
Calling Dr. BKap! Calling Dr. BKap!
/be
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 2•19 years ago
|
||
Aaron, is there a testcase that wants to be attached to this bug?
Comment 3•19 years ago
|
||
Well, just look at the url, not?
This is the testcase from the url.
Assignee | ||
Comment 4•19 years ago
|
||
Doh, I tend not to look at the URL field :(
I'll try to see what's going on when my new debug build finishes building.
Assignee: dbradley → mrbkap
Assignee | ||
Comment 5•19 years ago
|
||
So the problem here is that XPC native wrappers can have their functions called
with a |this| object that isn't a native wrapper if the native wrapper itself
is in the prototype chain. This patch makes XPCNativeWrappers deal with that
case.
Attachment #195793 -
Flags: superreview?(brendan)
Attachment #195793 -
Flags: review?(jst)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Comment 6•19 years ago
|
||
Comment on attachment 195793 [details] [diff] [review]
Fix
Cool, glad you avoided extra null tests in the common case by testing and
throwing inside the while loop.
/be
Attachment #195793 -
Flags: superreview?(brendan) → superreview+
Comment 8•19 years ago
|
||
Comment on attachment 195793 [details] [diff] [review]
Fix
r=jst
Attachment #195793 -
Flags: review?(jst) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #195793 -
Flags: approval1.8b5?
Assignee | ||
Comment 9•19 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Attachment #195793 -
Flags: approval1.8b5? → approval1.8b5+
You need to log in
before you can comment on or make changes to this bug.
Description
•