Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/S11.1.5_A1.1.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: "Evaluate the production ObjectLiteral: { }"
6 es5id: 11.1.5_A1.1
7 description: >
8 Checking various properteis of the object defined with "var object
9 = {}"
10 ---*/
11
12 var object = {};
13
14 //CHECK#1
15 if (typeof object !== "object") {
16 $ERROR('#1: var object = {}; typeof object === "object". Actual: ' + (typeof object));
17 }
18
19 //CHECK#2
20 if (object instanceof Object !== true) {
21 $ERROR('#2: var object = {}; object instanceof Object === true');
22 }
23
24 //CHECK#3
25 if (object.toString !== Object.prototype.toString) {
26 $ERROR('#3: var object = {}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));
27 }
28
29 //CHECK#4
30 if (object.toString() !== "[object Object]") {
31 $ERROR('#4: var object = {}; object.toString === "[object Object]". Actual: ' + (object.toString));
32 }