//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- function write(v) { WScript.Echo(v + ""); } function foo() { this.y = 10; } var o = new Object(); var f = new foo(); var a = new Array(); var s = new String("hello"); var b = new Boolean(true); var n = new Number(10); var d = new Date(); var r = new RegExp(); var e = new Error(); o.x = f.x = foo.x = a.x = s.x = b.x = n.x = d.x = r.x = e.x = 10; function doEval(str) { //write(str); write(str + " : " + eval(str)); } // Check for standard properties on various built-in constructors function Test1() { var objs = [ "Object", "Function", "Array", "String", "Boolean", "Number", "Math", "Date", "RegExp", "Error", "Object.prototype", "Function.prototype", "Array.prototype", "String.prototype", "Boolean.prototype", "Number.prototype", "Date.prototype", "RegExp.prototype", "Error.prototype", "o", "f", "foo", "foo.prototype", "a", "s", "b", "n", "d", "r", "e" ] var props = [ "abs", "acos", "anchor", "apply", "Array", "asin", "atan", "atan2", "big", "bind", "blink", "bold", "Boolean", "call", "ceil", "charAt", "charCodeAt", "concat", "constructor", "cos", "Date", "decodeURI", "decodeURIComponent", "description", "E", "encodeURI", "encodeURIComponent", "escape", "Error", "eval", "EvalError", "every", "exec", "exp", "flags", "filter", "fixed", "floor", "fontcolor", "fontsize", "forEach", "fromCharCode", "Function", "getDate", "getDay", "getFullYear", "getHours", "getMilliseconds", "getMinutes", "getMonth", "getSeconds", "getTime", "getTimezoneOffset", "getUTCDate", "getUTCDay", "getUTCFullYear", "getUTCHours", "getUTCMilliseconds", "getUTCMinutes", "getUTCMonth", "getUTCSeconds", "getYear", "hasOwnProperty", "indexOf", "Infinity", "isFinite", "isNaN", "isPrototypeOf", "italics", "join", "lastIndexOf", "length", "link", "LN10", "LN2", "localeCompare", "log", "LOG10E", "LOG2E", "map", "Math", "max", "MAX_VALUE", "match", "message", "min", "MIN_VALUE", "NaN", "name", "Now", "Number", "number", "NEGATIVE_INFINITY", "Object", "parse", "parseFloat", "parseInt", "PI", "pop", "POSITIVE_INFINITY", "pow", "propertyIsEnumerable", "prototype", "push", "random", "RangeError", "reduce", "reduceRight", "ReferenceError", "replace", "reverse", "round", "RegExp", "search", "setDate", "setFullYear", "setHours", "setMilliseconds", "setMinutes", "setMonth", "setSeconds", "setTime", "setUTCDate", "setUTCFullYear", "setUTCHours", "setUTCMilliseconds", "setUTCMinutes", "setUTCMonth", "setUTCSeconds", "setYear", "shift", "sin", "slice", "some", "sort", "source", "splice", "split", "sqrt", "SQRT1_2", "SQRT2", "strike", "String", "sub", "substring", "substr", "sup", "SyntaxError", "tan", "test", "toDateString", "toExponential", "toFixed", "toISOString", "toJSON", "toLocaleDateString", "toLocaleLowerCase", "toLocaleString", "toLocaleTimeString", "toLocaleUpperCase", "toLowerCase", "toPrecision", "toString", "toTimeString", "toUpperCase", "toUTCString", "trim", "TypeError", "undefined", "unescape", "unshift", "URIError", "UTC", "valueOf", "enumerable", "configurable", "writable", "value", "get", "set", "defineProperty", "defineProperties", "toGMTString", "compile", "global", "lastIndex", "multiline", "ignoreCase", "index", "input", "lastMatch", "lastParen", "leftContext", "rightContext", "x", "y" ]; for (var i=0; i