Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/S15.2.1.1_A1_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 When the Object(value) is called and the value is null, undefined or not supplied,
7 create and return a new Object object if the object constructor had been called with the same arguments (15.2.2.1)
8 es5id: 15.2.1.1_A1_T2
9 description: Creating Object(void 0) and checking its properties
10 ---*/
11
12 //var y= void 0;
13
14 var __obj = Object(void 0);
15
16 var n__obj = new Object(void 0);
17
18
19 if (__obj.toString() !== n__obj.toString()) {
20 $ERROR('#1');
21 }
22
23 if (__obj.constructor !== n__obj.constructor) {
24 $ERROR('#2');
25 }
26
27 if (__obj.prototype !== n__obj.prototype) {
28 $ERROR('#3');
29 }
30
31 if (__obj.toLocaleString() !== n__obj.toLocaleString()) {
32 $ERROR('#4');
33 }
34
35 if (typeof __obj !== typeof n__obj) {
36 $ERROR('#5');
37 }