michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Result of applying "typeof" operator to the object that is native and doesn't implement [[Call]] is "object" michael@0: * michael@0: * @path ch11/11.4/11.4.3/S11.4.3_A3.6.js michael@0: * @description typeof (object without [[Call]]) === "object" michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: if (typeof this !== "object") { michael@0: $ERROR('#1: typeof this === "object". Actual: ' + (typeof this)); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: if (typeof new Object() !== "object") { michael@0: $ERROR('#2: typeof new Object() === "object". Actual: ' + (typeof new Object())); michael@0: } michael@0: michael@0: //CHECK#3 michael@0: if (typeof new Array(1,2,3) !== "object") { michael@0: $ERROR('#3: typeof new Array(1,2,3) === "object". Actual: ' + (typeof new Array(1,2,3))); michael@0: } michael@0: michael@0: //CHECK#4 michael@0: if (typeof Array(1,2,3) !== "object") { michael@0: $ERROR('#4: typeof Array(1,2,3) === "object". Actual: ' + (typeof Array(1,2,3))); michael@0: } michael@0: michael@0: //CHECK#5 michael@0: if (typeof new String("x") !== "object") { michael@0: $ERROR('#5: typeof new String("x") === "object". Actual: ' + (typeof new String("x"))); michael@0: } michael@0: michael@0: //CHECK#6 michael@0: if (typeof new Boolean(true) !== "object") { michael@0: $ERROR('#6: typeof new Boolean(true) === "object". Actual: ' + (typeof new Boolean(true))); michael@0: } michael@0: michael@0: //CHECK#7 michael@0: if (typeof new Number(1) !== "object") { michael@0: $ERROR('#7: typeof new Number(1) === "object". Actual: ' + (typeof new Number(1))); michael@0: } michael@0: michael@0: //CHECK#8 michael@0: //The Math object does not have a [[Construct]] property; michael@0: //it is not possible to use the Math object as a constructor with the new operator. michael@0: //The Math object does not have a [[Call]] property; it is not possible to invoke the Math object as a object. michael@0: if (typeof Math !== "object") { michael@0: $ERROR('#8: typeof Math === "object". Actual: ' + (typeof Math)); michael@0: } michael@0: michael@0: //CHECK#9 michael@0: if (typeof new Date() !== "object") { michael@0: $ERROR('#9: typeof new Date() === "object". Actual: ' + (typeof new Date())); michael@0: } michael@0: michael@0: //CHECK#10 michael@0: if (typeof new Error() !== "object") { michael@0: $ERROR('#10: typeof new Error() === "object". Actual: ' + (typeof new Error())); michael@0: } michael@0: michael@0: //CHECK#11 michael@0: if (typeof new RegExp() !== "object") { michael@0: $ERROR('#11: typeof new RegExp() === "object". Actual: ' + (typeof new RegExp())); michael@0: } michael@0: michael@0: //CHECK#12 michael@0: if (typeof RegExp() !== "object") { michael@0: $ERROR('#12: typeof RegExp() === "object". Actual: ' + (typeof RegExp())); michael@0: } michael@0: