Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/defineProperty/null-handler-realm.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-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc
5 es6id: 9.5.6
6 description: >
7 Throws a TypeError exception if handler is null (honoring the realm of the
8 current execution context).
9 info: |
10 1. Assert: IsPropertyKey(P) is true.
11 2. Let handler be O.[[ProxyHandler]].
12 3. If handler is null, throw a TypeError exception.
13 features: [cross-realm]
14 ---*/
15
16 var OProxy = $262.createRealm().global.Proxy;
17 var p = OProxy.revocable(Object.create(null), {});
18
19 p.revoke();
20
21 assert.throws(TypeError, function() {
22 p.proxy.prop = null;
23 });