Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/isNaN/toprimitive-get-abrupt.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 /*---
5 es6id: 18.2.3
6 esid: sec-isnan-number
7 description: >
8 Return abrupt completion getting number.@@toPrimitive
9 info: |
10 isNaN (number)
11
12 1. Let num be ? ToNumber(number).
13
14 ToPrimitive ( input [ , PreferredType ] )
15
16 [...]
17 4. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).
18 features: [Symbol.toPrimitive]
19 ---*/
20
21 var obj = Object.defineProperty({}, Symbol.toPrimitive, {
22 get: function() {
23 throw new Test262Error();
24 }
25 });
26
27 assert.throws(Test262Error, function() {
28 isNaN(obj);
29 });