Debian Codegraph @

js/src/tests/test262/built-ins/Object/seal/abrupt-completion.js

raw
1 // Copyright (C) 2019 Alexey Shvayka. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-object.seal
6 description: >
7 O.[[PreventExtensions]]() returns abrupt completion.
8 info: |
9 Object.seal ( O )
10
11 ...
12 2. Let status be ? SetIntegrityLevel(O, sealed).
13
14 SetIntegrityLevel ( O, level )
15
16 ...
17 3. Let status be ? O.[[PreventExtensions]]().
18 features: [Proxy]
19 ---*/
20
21 var p = new Proxy({}, {
22 preventExtensions: function() {
23 throw new Test262Error();
24 },
25 });
26
27 assert.throws(Test262Error, function() {
28 Object.seal(p);
29 });
30
31 reportCompare(0, 0);