mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1111785 - Test for Array.isArray with a proxy. r=Waldo
This commit is contained in:
parent
e9a9b923b1
commit
e5ff441e0a
30
js/src/tests/ecma_6/Array/isArray.js
Normal file
30
js/src/tests/ecma_6/Array/isArray.js
Normal file
@ -0,0 +1,30 @@
|
||||
assertEq(Array.isArray([]), true);
|
||||
|
||||
var proxy = new Proxy([], {});
|
||||
assertEq(Array.isArray(proxy), true);
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
proxy = new Proxy(proxy, {});
|
||||
assertEq(Array.isArray(proxy), true);
|
||||
}
|
||||
|
||||
var revocable = Proxy.revocable([], {});
|
||||
proxy = revocable.proxy;
|
||||
assertEq(Array.isArray(proxy), true);
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
proxy = new Proxy(proxy, {});
|
||||
assertEq(Array.isArray(proxy), true);
|
||||
}
|
||||
|
||||
revocable.revoke();
|
||||
assertEq(Array.isArray(revocable.proxy), false);
|
||||
assertEq(Array.isArray(proxy), false);
|
||||
|
||||
var global = newGlobal();
|
||||
var array = global.Array();
|
||||
assertEq(Array.isArray(array), true);
|
||||
assertEq(Array.isArray(new Proxy(array, {})), true);
|
||||
assertEq(Array.isArray(new global.Proxy(array, {})), true);
|
||||
|
||||
reportCompare(true, true);
|
Loading…
Reference in New Issue
Block a user