Open Bug 586453 Opened 10 years ago Updated 3 years ago

Function.caller is null after Cu.import or mozIJSSubScriptLoader.loadSubScript

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

People

(Reporter: mash, Unassigned)

References

Details

Attachments

(1 file)

2.03 KB, application/x-xpinstall
Details
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b4pre) Gecko/20100810 Minefield/4.0b4pre
Build Identifier: 

Function.caller is null after Components.utils.import(..) or mozIJSSubScriptLoader.loadSubScript(..)

Reproducible: Always
Attached file Sample extension
Actual Results
(Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b4pre) Gecko/20100810 Minefield/4.0b4pre)

-== TestCaller.caller ==-
function (outer, iid) {
    if (outer) {
        throw Cr.NS_ERROR_NO_AGGREGATION;
    }
    return (new component).QueryInterface(iid);
}
-== testFn.caller ==-
function TestCaller() {
    dump("-== TestCaller.caller ==-\n" + TestCaller.caller + "\n");
    testFn();
    dump("-== TestCaller.caller ==-\n" + TestCaller.caller + "\n");
}
-== callertest.caller (1) ==-
function testFn() {
    dump("-== testFn.caller ==-\n" + testFn.caller + "\n");
    callertest(1);
    try {
    } catch (e) {
    }
    Cu.import("resource://testcaller/test.jsm");
    callertest(2);
    dump("-== testFn.caller ==-\n" + testFn.caller + "\n");
}
-== callertest.caller (2) ==-
null
-== testFn.caller ==-
null
-== TestCaller.caller ==-
null


Expected Results
(Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9pre) Gecko/20100810 Namoroka/3.6.9pre)

-== TestCaller.caller ==-
function (outer, iid) {
    if (outer) {
        throw Cr.NS_ERROR_NO_AGGREGATION;
    }
    return (new component).QueryInterface(iid);
}
-== testFn.caller ==-
function TestCaller() {
    dump("-== TestCaller.caller ==-\n" + TestCaller.caller + "\n");
    testFn();
    dump("-== TestCaller.caller ==-\n" + TestCaller.caller + "\n");
}
-== callertest.caller (1) ==-
function testFn() {
    dump("-== testFn.caller ==-\n" + testFn.caller + "\n");
    callertest(1);
    try {
    } catch (e) {
    }
    Cu.import("resource://testcaller/test.jsm");
    callertest(2);
    dump("-== testFn.caller ==-\n" + testFn.caller + "\n");
}
-== callertest.caller (2) ==-
function testFn() {
    dump("-== testFn.caller ==-\n" + testFn.caller + "\n");
    callertest(1);
    try {
    } catch (e) {
    }
    Cu.import("resource://testcaller/test.jsm");
    callertest(2);
    dump("-== testFn.caller ==-\n" + testFn.caller + "\n");
}
-== testFn.caller ==-
function TestCaller() {
    dump("-== TestCaller.caller ==-\n" + TestCaller.caller + "\n");
    testFn();
    dump("-== TestCaller.caller ==-\n" + TestCaller.caller + "\n");
}
-== TestCaller.caller ==-
function (outer, iid) {
    if (outer) {
        throw Cr.NS_ERROR_NO_AGGREGATION;
    }
    return (new component).QueryInterface(iid);
}
ok: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b3pre) Gecko/20100730 Minefield/4.0b3pre
ok: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b3pre) Gecko/20100731 Minefield/4.0b3pre
not ok: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b3pre) Gecko/20100801 Minefield/4.0b3pre
I think I found an hg bisect bug in the process, and perhaps this is already obvious given the CC list, but I finally ended up finding that this was introduced by:

changeset:   48503:3cdb70716688
user:        Blake Kaplan <mrbkap@gmail.com>
date:        Mon Jul 19 13:36:49 2010 -0700
summary:     Bug 563106 - Tie XPConnect to compartments. r=jorendorff/gal/jst
Blocks: 563106
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: general → mrbkap
Assignee: mrbkap → nobody
You need to log in before you can comment on or make changes to this bug.