Debian Codegraph @

js/src/tests/test262/built-ins/String/S15.5.5_A2_T1.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: String instance has not [[construct]] property
6 es5id: 15.5.5_A2_T1
7 description: Create new string object and try new created_string
8 ---*/
9
10 var __str = new Object("");
11
12 //////////////////////////////////////////////////////////////////////////////
13 //CHECK#1
14 try {
15 new __str;
16 throw new Test262Error('#1: __str = new Object(""); "new __str" lead to throwing exception');
17 } catch (e) {
18 if (!(e instanceof TypeError)) {
19 throw new Test262Error('#1.1: Exception is instance of TypeError. Actual: exception is ' + e);
20 }
21 }
22 //
23 //////////////////////////////////////////////////////////////////////////////
24
25 reportCompare(0, 0);