mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Backed out changeset 88860bed8c96 (bug 1042398) for bustage on a CLOSED TREE
This commit is contained in:
parent
db3599ee0f
commit
d06077ac4b
@ -1,36 +0,0 @@
|
||||
const Cu = Components.utils;
|
||||
function run_test() {
|
||||
|
||||
var toEval = [
|
||||
"var customIterator = {",
|
||||
" _array: [6, 7, 8, 9],",
|
||||
" __iterator__: function() {",
|
||||
" for (var i = 0; i < this._array.length; ++i)",
|
||||
" yield this._array[i];",
|
||||
" }",
|
||||
"}"
|
||||
].join('\n');
|
||||
|
||||
function checkIterator(iterator) {
|
||||
var control = [6, 7, 8, 9];
|
||||
var i = 0;
|
||||
for (var item in iterator) {
|
||||
do_check_eq(item, control[i]);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
// First, try in our own scope.
|
||||
eval(toEval);
|
||||
checkIterator(customIterator);
|
||||
|
||||
// Next, try a vanilla CCW.
|
||||
var sbChrome = Cu.Sandbox(this);
|
||||
Cu.evalInSandbox(toEval, sbChrome, '1.7');
|
||||
checkIterator(sbChrome.customIterator);
|
||||
|
||||
// Finally, try an Xray waiver.
|
||||
var sbContent = Cu.Sandbox('http://www.example.com');
|
||||
Cu.evalInSandbox(toEval, sbContent, '1.7');
|
||||
checkIterator(Cu.waiveXrays(sbContent.customIterator));
|
||||
}
|
@ -99,4 +99,3 @@ head = head_watchdog.js
|
||||
[test_watchdog_hibernate.js]
|
||||
head = head_watchdog.js
|
||||
[test_writeToGlobalPrototype.js]
|
||||
[test_xrayed_iterator.js]
|
||||
|
Loading…
Reference in New Issue
Block a user