Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/S15.2.1.1_A1_T4.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_T4
9 description: Creating Object(undefined) and checking its properties
10 ---*/
11
12 var __obj = Object(undefined);
13
14 var n__obj = new Object(undefined);
15
16 if (__obj.toString() !== n__obj.toString()) {
17 $ERROR('#1');
18 }
19
20 if (__obj.constructor !== n__obj.constructor) {
21 $ERROR('#2');
22 }
23
24 if (__obj.prototype !== n__obj.prototype) {
25 $ERROR('#3');
26 }
27
28 if (__obj.toLocaleString() !== n__obj.toLocaleString()) {
29 $ERROR('#4');
30 }
31
32 if (typeof __obj !== typeof n__obj) {
33 $ERROR('#5');
34 }