Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/defineProperty/trap-is-not-callable-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 if trap is not callable (honoring the Realm of the current execution
8 context)
9 info: |
10 [[DefineOwnProperty]] (P, Desc)
11
12 ...
13 6. Let trap be GetMethod(handler, "defineProperty").
14 ...
15 7.3.9 GetMethod (O, P)
16 ...
17 2. Let func be GetV(O, P).
18 5. If IsCallable(func) is false, throw a TypeError exception.
19 ...
20 features: [cross-realm]
21 ---*/
22
23 var OProxy = $262.createRealm().global.Proxy;
24 var p = new OProxy({}, {
25 defineProperty: {}
26 });
27
28 assert.throws(TypeError, function() {
29 Object.defineProperty(p, "foo", {
30 value: 1
31 });
32 });