Debian Codegraph @

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