Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Array / prototype / concat / is-concat-spreadable-proxy-revoked.js
blob41f4bfb6c385b1d08fa7e9e85f60253613a1e697
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-isconcatspreadable
5 description: >
6   Revoked proxy value produces a TypeError during access of
7   `Symbol.isConcatSpreadable` property
8 info: |
9   [...]
10   5. Repeat, while items is not empty
11      a. Remove the first element from items and let E be the value of the
12         element.
13      b. Let spreadable be ? IsConcatSpreadable(E).
14      c. If spreadable is true, then
15         [...]
16      e. Else E is added as a single item rather than spread,
17         [...]
19   ES6 22.1.3.1.1: Runtime Semantics: IsConcatSpreadable ( O )
21   1. If Type(O) is not Object, return false.
22   2. Let spreadable be ? Get(O, @@isConcatSpreadable).
24   7.3.1 Get
26   [...]
27   3. Return ? O.[[Get]](P, O).
29   9.5.8 [[Get]]
31   [...]
32   2. Let handler be O.[[ProxyHandler]].
33   3. If handler is null, throw a TypeError exception.
34 features: [Proxy]
35 ---*/
37 var handle = Proxy.revocable([], {});
39 handle.revoke();
41 assert.throws(TypeError, function() {
42   [].concat(handle.proxy);
43 }, '[].concat(handle.proxy) throws a TypeError exception');
45 reportCompare(0, 0);