Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Array/isArray/proxy-revoked.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-array.isarray
5 es6id: 22.1.2.2
6 description: Revoked proxy value produces a TypeError
7 info: |
8 1. Return IsArray(arg).
9
10 7.2.2 IsArray
11
12 [...]
13 3. If argument is a Proxy exotic object, then
14 a. If the value of the [[ProxyHandler]] internal slot of argument is null,
15 throw a TypeError exception.
16 b. Let target be the value of the [[ProxyTarget]] internal slot of
17 argument.
18 c. Return ? IsArray(target).
19 features: [Proxy]
20 ---*/
21
22 var handle = Proxy.revocable([], {});
23
24 handle.revoke();
25
26 assert.throws(TypeError, function() {
27 Array.isArray(handle.proxy);
28 });