blob: a701c3b21e5f2d306de91c7274aad38501fc2c7a [file] [log] [blame]
Test to ensure correct behaviour of Object.getOwnPropertyNames
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS getSortedOwnPropertyNames({}) is []
PASS getSortedOwnPropertyNames({a:null}) is ['a']
PASS getSortedOwnPropertyNames({a:null, b:null}) is ['a', 'b']
PASS getSortedOwnPropertyNames({b:null, a:null}) is ['a', 'b']
PASS getSortedOwnPropertyNames({__proto__:{a:null}}) is []
PASS getSortedOwnPropertyNames({__proto__:[1,2,3]}) is []
PASS getSortedOwnPropertyNames(Object.create({}, { 'a': { 'value': 1, 'enumerable': false } })) is ['a']
PASS getSortedOwnPropertyNames(Object.create([1,2,3], { 'a': { 'value': 1, 'enumerable': false } })) is ['a']
PASS getSortedOwnPropertyNames(new Function()) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames((function(){var x=new Function();x.__proto__=[1,2,3];return x;})()) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(new String('')) is ['length']
PASS getSortedOwnPropertyNames(new String('a')) is ['0', 'length']
PASS getSortedOwnPropertyNames(new String('abc')) is ['0', '1', '2', 'length']
PASS getSortedOwnPropertyNames((function(){var x=new String('');x.__proto__=[1,2,3];return x;})()) is ['length']
PASS getSortedOwnPropertyNames((function(){var x=new String('abc');x.bar='baz';x[999]='d';return x;})()) is ['0', '1', '2', '999', 'bar', 'length']
PASS getSortedOwnPropertyNames([]) is ['length']
PASS getSortedOwnPropertyNames([null]) is ['0', 'length']
PASS getSortedOwnPropertyNames([null,null]) is ['0','1', 'length']
PASS getSortedOwnPropertyNames([null,null,,,,null]) is ['0','1','5', 'length']
PASS getSortedOwnPropertyNames((function(){var x=[];x.__proto__=[1,2,3];return x;})()) is ['length']
PASS getSortedOwnPropertyNames(new Date()) is []
PASS getSortedOwnPropertyNames((function(){var x=new Date();x.__proto__=[1,2,3];return x;})()) is []
PASS getSortedOwnPropertyNames(new RegExp('foo')) is ['lastIndex']
PASS getSortedOwnPropertyNames((function(){var x=new RegExp();x.__proto__=[1,2,3];return x;})()) is ['lastIndex']
PASS getSortedOwnPropertyNames(argumentsObject()) is ['callee', 'length']
PASS getSortedOwnPropertyNames(argumentsObject(1)) is ['0', 'callee', 'length']
PASS getSortedOwnPropertyNames(argumentsObject(1,2,3)) is ['0', '1', '2', 'callee', 'length']
PASS getSortedOwnPropertyNames((function(){arguments.__proto__=[1,2,3];return arguments;})()) is ['callee', 'length']
PASS getSortedOwnPropertyNames(Object(Symbol.iterator)) is []
PASS getSortedOwnPropertyNames(parseInt) is ['length', 'name']
PASS getSortedOwnPropertyNames(parseFloat) is ['length', 'name']
PASS getSortedOwnPropertyNames(isNaN) is ['length', 'name']
PASS getSortedOwnPropertyNames(isFinite) is ['length', 'name']
PASS getSortedOwnPropertyNames(escape) is ['length', 'name']
PASS getSortedOwnPropertyNames(unescape) is ['length', 'name']
PASS getSortedOwnPropertyNames(decodeURI) is ['length', 'name']
PASS getSortedOwnPropertyNames(decodeURIComponent) is ['length', 'name']
PASS getSortedOwnPropertyNames(encodeURI) is ['length', 'name']
PASS getSortedOwnPropertyNames(encodeURIComponent) is ['length', 'name']
PASS getSortedOwnPropertyNames(Object) is ['assign', 'create', 'defineProperties', 'defineProperty', 'entries', 'freeze', 'fromEntries', 'getOwnPropertyDescriptor', 'getOwnPropertyDescriptors', 'getOwnPropertyNames', 'getOwnPropertySymbols', 'getPrototypeOf', 'hasOwn', 'is', 'isExtensible', 'isFrozen', 'isSealed', 'keys', 'length', 'name', 'preventExtensions', 'prototype', 'seal', 'setPrototypeOf', 'values']
PASS getSortedOwnPropertyNames(Object.prototype) is ['__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', '__proto__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']
PASS getSortedOwnPropertyNames(Function) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']
PASS getSortedOwnPropertyNames(Array) is ['from', 'isArray', 'length', 'name', 'of', 'prototype']
PASS getSortedOwnPropertyNames(Array.prototype) is ['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toReversed', 'toSorted', 'toSpliced', 'toString', 'unshift', 'values', 'with']
PASS getSortedOwnPropertyNames(String) is ['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw']
PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'at', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'matchAll', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'replaceAll', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']
PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(Boolean.prototype) is ['constructor', 'toString', 'valueOf']
PASS getSortedOwnPropertyNames(Number) is ['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']
PASS getSortedOwnPropertyNames(Number.prototype) is ['constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf']
PASS getSortedOwnPropertyNames(Date) is ['UTC', 'length', 'name', 'now', 'parse', 'prototype']
PASS getSortedOwnPropertyNames(Date.prototype) is ['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf']
PASS getSortedOwnPropertyNames(RegExp) is ['$&', "$'", '$*', '$+', '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9', '$_', '$`', 'input', 'lastMatch', 'lastParen', 'leftContext', 'length', 'multiline', 'name', 'prototype', 'rightContext']
PASS getSortedOwnPropertyNames(RegExp.prototype) is ['compile', 'constructor', 'dotAll', 'exec', 'flags', 'global', 'hasIndices', 'ignoreCase', 'multiline', 'source', 'sticky', 'test', 'toString', 'unicode']
PASS getSortedOwnPropertyNames(Error) is ['length', 'name', 'prototype', 'stackTraceLimit']
PASS getSortedOwnPropertyNames(Error.prototype) is ['constructor', 'message', 'name', 'toString']
PASS getSortedOwnPropertyNames(Math) is ['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']
PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify']
PASS getSortedOwnPropertyNames(Symbol) is ['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'matchAll', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']
PASS getSortedOwnPropertyNames(Symbol.prototype) is ['constructor', 'description', 'toString', 'valueOf']
PASS getSortedOwnPropertyNames(Map) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(Map.prototype) is ['clear', 'constructor', 'delete', 'entries', 'forEach', 'get', 'has', 'keys', 'set', 'size', 'values']
PASS getSortedOwnPropertyNames(Set) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(Set.prototype) is ['add', 'clear', 'constructor', 'delete', 'entries', 'forEach', 'has', 'keys', 'size', 'values']
PASS getSortedOwnPropertyNames(WeakMap) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(WeakMap.prototype) is ['constructor', 'delete', 'get', 'has', 'set']
PASS getSortedOwnPropertyNames(WeakSet) is ['length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(WeakSet.prototype) is ['add', 'constructor', 'delete', 'has']
PASS globalPropertyNames.indexOf('NaN') != -1 is true
PASS globalPropertyNames.indexOf('Infinity') != -1 is true
PASS globalPropertyNames.indexOf('undefined') != -1 is true
PASS globalPropertyNames.indexOf('parseInt') != -1 is true
PASS globalPropertyNames.indexOf('parseFloat') != -1 is true
PASS globalPropertyNames.indexOf('isNaN') != -1 is true
PASS globalPropertyNames.indexOf('isFinite') != -1 is true
PASS globalPropertyNames.indexOf('escape') != -1 is true
PASS globalPropertyNames.indexOf('unescape') != -1 is true
PASS globalPropertyNames.indexOf('decodeURI') != -1 is true
PASS globalPropertyNames.indexOf('decodeURIComponent') != -1 is true
PASS globalPropertyNames.indexOf('encodeURI') != -1 is true
PASS globalPropertyNames.indexOf('encodeURIComponent') != -1 is true
PASS globalPropertyNames.indexOf('Object') != -1 is true
PASS globalPropertyNames.indexOf('Function') != -1 is true
PASS globalPropertyNames.indexOf('Array') != -1 is true
PASS globalPropertyNames.indexOf('String') != -1 is true
PASS globalPropertyNames.indexOf('Symbol') != -1 is true
PASS globalPropertyNames.indexOf('Boolean') != -1 is true
PASS globalPropertyNames.indexOf('Number') != -1 is true
PASS globalPropertyNames.indexOf('Date') != -1 is true
PASS globalPropertyNames.indexOf('RegExp') != -1 is true
PASS globalPropertyNames.indexOf('Error') != -1 is true
PASS globalPropertyNames.indexOf('Math') != -1 is true
PASS globalPropertyNames.indexOf('JSON') != -1 is true
PASS globalPropertyNames.indexOf('Map') != -1 is true
PASS globalPropertyNames.indexOf('Set') != -1 is true
PASS globalPropertyNames.indexOf('WeakMap') != -1 is true
PASS globalPropertyNames.indexOf('WeakSet') != -1 is true
PASS successfullyParsed is true
TEST COMPLETE