Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/call/S11.2.3_A4_T2.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 If MemberExpression does not implement the internal [[Call]] method,
7 throw TypeError
8 es5id: 11.2.3_A4_T2
9 description: Checking Number object case
10 ---*/
11
12 //CHECK#1
13 try {
14 new Number(1)();
15 $ERROR('#1.1: new Number(1)() throw TypeError. Actual: ' + (new Number(1)()));
16 }
17 catch (e) {
18 if ((e instanceof TypeError) !== true) {
19 $ERROR('#1.2: new Number(1)() throw TypeError. Actual: ' + (e));
20 }
21 }
22
23 //CHECK#2
24 try {
25 var x = new Number(1);
26 x();
27 $ERROR('#2.1: var x = new Number(1); x() throw TypeError. Actual: ' + (x()));
28 }
29 catch (e) {
30 if ((e instanceof TypeError) !== true) {
31 $ERROR('#2.2: var x = new Number(1); x() throw TypeError. Actual: ' + (e));
32 }
33 }