Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/set/trap-is-not-callable.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 9.5.9
5 description: >
6 Trap is not callable.
7 info: |
8 [[Set]] ( P, V, Receiver)
9
10 6. Let trap be GetMethod(handler, "set").
11 ...
12
13 7.3.9 GetMethod (O, P)
14
15 5. If IsCallable(func) is false, throw a TypeError exception.
16 ---*/
17
18 var p = new Proxy({}, {
19 set: {}
20 });
21
22 assert.throws(TypeError, function() {
23 p.attr = 1;
24 });
25
26 assert.throws(TypeError, function() {
27 p["attr"] = 1;
28 });