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.
Calling Dr. BKap! Calling Dr. BKap! /be
Aaron, is there a testcase that wants to be attached to this bug?
Created attachment 195768 [details] testcase Well, just look at the url, not? This is the testcase from the url.
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.
Created attachment 195793 [details] [diff] [review] Fix 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.
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
We need this fixed for 1.8final/Firefox 1.5. /be
Comment on attachment 195793 [details] [diff] [review] Fix r=jst
Fix checked into trunk.
Fix checked into MOZILLA_1_8_BRANCH.