eval-introduction-principals.js (628B)
1 // Ensure the introduction info for eval scripts respects principal checks. 2 3 function myAPI(f) { return f(); } 4 5 var contentGlobal = newGlobal({principal: 0x1}); 6 contentGlobal.chrome = this; 7 contentGlobal.eval("\n" + 8 "function contentTest() { chrome.myAPI(eval.bind(undefined, 'chrome.stack = Error().stack;')) };\n" + 9 "contentTest();"); 10 11 // Note that the stack below does not include the current filename or file 12 // line numbers, and there's no trace of the myAPI call between the two 13 // evals. 14 assertEq(stack, "@eval line 2 > eval:1:16\n" + 15 "contentTest@eval:2:33\n" + 16 "@eval:3:1\n");