Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Map/get-set-method-failure.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: 23.1.1.1
5 description: >
6 new Map returns abrupt from getting Map.prototype.set.
7 info: |
8 Map ( [ iterable ] )
9
10 ...
11 7. Else,
12 a. Let adder be Get(map, "add").
13 b. ReturnIfAbrupt(adder).
14 ---*/
15
16 Object.defineProperty(Map.prototype, 'set', {
17 get: function() {
18 throw new Test262Error();
19 }
20 });
21
22 new Map();
23
24 assert.throws(Test262Error, function() {
25 new Map([]);
26 });