Debian Codegraph @

js/src/tests/test262/language/expressions/property-accessors/S11.2.1_A3_T5.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 MemberExpression calls ToObject(MemberExpression) and
7 ToString(Expression). CallExpression calls ToObject(CallExpression) and
8 ToString(Expression)
9 es5id: 11.2.1_A3_T5
10 description: Checking "null" case
11 ---*/
12
13 //CHECK#1
14 try {
15 null.toString();
16 throw new Test262Error('#1.1: null.toString() throw TypeError. Actual: ' + (null.toString()));
17 }
18 catch (e) {
19 if ((e instanceof TypeError) !== true) {
20 throw new Test262Error('#1.2: null.toString() throw TypeError. Actual: ' + (e));
21 }
22 }
23
24 //CHECK#2
25 try {
26 null["toString"]();
27 throw new Test262Error('#2.1: null["toString"]() throw TypeError. Actual: ' + (null["toString"]()));
28 }
29 catch (e) {
30 if ((e instanceof TypeError) !== true) {
31 throw new Test262Error('#2.2: null["toString"]() throw TypeError. Actual: ' + (e));
32 }
33 }
34
35 reportCompare(0, 0);