Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/S15.2.2.1_A3_T3.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 When the Object constructor is called with one argument value and
7 the type of value is String, return ToObject(string)
8 es5id: 15.2.2.1_A3_T3
9 description: Argument value is sum of empty string and number
10 ---*/
11
12 var n_obj = new Object("" + 1);
13
14 //CHECK#2
15 if (n_obj.constructor !== String) {
16 $ERROR('#2: When the Object constructor is called with String argument return ToObject(string)');
17 }
18
19 //CHECK#3
20 if (typeof n_obj !== 'object') {
21 $ERROR('#3: When the Object constructor is called with String argument return ToObject(string)');
22 }
23
24 //CHECK#4
25 if (n_obj != "1") {
26 $ERROR('#4: When the Object constructor is called with String argument return ToObject(string)');
27 }
28
29 //CHECK#5
30 if (n_obj === "1") {
31 $ERROR('#5: When the Object constructor is called with String argument return ToObject(string)');
32 }