blob: 0554454917745aa7ad7828a37f5f24eb7e4c0ba7 [file] [log] [blame]
Test to ensure correct behaviour of Object.getOwnPropertyDescriptor
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.getOwnPropertyDescriptor({}, 'undefinedProperty') is undefined.
PASS Object.getOwnPropertyDescriptor({definedProperty:'defined'}, 'definedProperty').value is "defined"
PASS Object.getOwnPropertyDescriptor({definedProperty:'defined'}, 'definedProperty').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor({definedProperty:'defined'}, 'definedProperty').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor({definedProperty:'defined'}, 'definedProperty').enumerable is true
PASS Object.getOwnPropertyDescriptor({definedProperty:'defined'}, 'definedProperty').configurable is true
PASS Object.getOwnPropertyDescriptor(Array.prototype, 'concat').value is Array.prototype.concat
PASS Object.getOwnPropertyDescriptor(Array.prototype, 'concat').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Array.prototype, 'concat').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Array.prototype, 'concat').enumerable is false
PASS Object.getOwnPropertyDescriptor(Array.prototype, 'concat').configurable is true
PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toISOString').value is Date.prototype.toISOString
PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toISOString').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toISOString').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toISOString').enumerable is false
PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toISOString').configurable is true
PASS Object.getOwnPropertyDescriptor(String.prototype, 'concat').value is String.prototype.concat
PASS Object.getOwnPropertyDescriptor(String.prototype, 'concat').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(String.prototype, 'concat').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(String.prototype, 'concat').enumerable is false
PASS Object.getOwnPropertyDescriptor(String.prototype, 'concat').configurable is true
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'exec').value is RegExp.prototype.exec
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'exec').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'exec').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'exec').enumerable is false
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'exec').configurable is true
PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').value is document.createElement
PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').enumerable is true
PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').configurable is false
PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').value is Number.NEGATIVE_INFINITY
PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').enumerable is false
PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').configurable is false
PASS Object.getOwnPropertyDescriptor(RegExp, '$_').value is RegExp.$_
PASS Object.getOwnPropertyDescriptor(RegExp, '$_').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(RegExp, '$_').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(RegExp, '$_').enumerable is false
PASS Object.getOwnPropertyDescriptor(RegExp, '$_').configurable is true
PASS Object.getOwnPropertyDescriptor(/a/g, 'global').value is true
PASS Object.getOwnPropertyDescriptor(/a/g, 'global').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(/a/g, 'global').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(/a/g, 'global').enumerable is false
PASS Object.getOwnPropertyDescriptor(/a/g, 'global').configurable is false
PASS Object.getOwnPropertyDescriptor(Node, 'DOCUMENT_POSITION_DISCONNECTED').value is Node.DOCUMENT_POSITION_DISCONNECTED
PASS Object.getOwnPropertyDescriptor(Node, 'DOCUMENT_POSITION_DISCONNECTED').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Node, 'DOCUMENT_POSITION_DISCONNECTED').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Node, 'DOCUMENT_POSITION_DISCONNECTED').enumerable is true
PASS Object.getOwnPropertyDescriptor(Node, 'DOCUMENT_POSITION_DISCONNECTED').configurable is false
PASS Object.getOwnPropertyDescriptor(Math, 'sin').value is Math.sin
PASS Object.getOwnPropertyDescriptor(Math, 'sin').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Math, 'sin').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Math, 'sin').enumerable is false
PASS Object.getOwnPropertyDescriptor(Math, 'sin').configurable is true
PASS Object.getOwnPropertyDescriptor([1,2,3], 0).value is 1
PASS Object.getOwnPropertyDescriptor([1,2,3], 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 0).enumerable is true
PASS Object.getOwnPropertyDescriptor([1,2,3], 0).configurable is true
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').value is 3
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').enumerable is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').configurable is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').value is 3
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').enumerable is false
PASS Object.getOwnPropertyDescriptor([1,2,3], 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 0).value is 'a'
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 0).configurable is true
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 'length').value is 2
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 'length').enumerable is false
PASS Object.getOwnPropertyDescriptor(/(a)*/g.exec('a'), 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(function(){}, 'length').value is 0
PASS Object.getOwnPropertyDescriptor(function(){}, 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(function(){}, 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(function(){}, 'length').enumerable is false
PASS Object.getOwnPropertyDescriptor(function(){}, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'length').value is 1
PASS Object.getOwnPropertyDescriptor(Math.sin, 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'length').enumerable is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'name').value is 'sin'
PASS Object.getOwnPropertyDescriptor(Math.sin, 'name').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'name').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'name').enumerable is false
PASS Object.getOwnPropertyDescriptor(Math.sin, 'name').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 'global').value is global
PASS Object.getOwnPropertyDescriptor(global, 'global').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'global').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'global').enumerable is true
PASS Object.getOwnPropertyDescriptor(global, 'global').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 'undefined').value is undefined
PASS Object.getOwnPropertyDescriptor(global, 'undefined').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'undefined').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'undefined').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'undefined').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 'NaN').value is NaN
PASS Object.getOwnPropertyDescriptor(global, 'NaN').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'NaN').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'NaN').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'NaN').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 'Infinity').value is Infinity
PASS Object.getOwnPropertyDescriptor(global, 'Infinity').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Infinity').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Infinity').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Infinity').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 'window').value is global
PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'window').enumerable is true
PASS Object.getOwnPropertyDescriptor(global, 'window').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').value is XMLHttpRequest
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'length').value is global.length
PASS Object.getOwnPropertyDescriptor(global, 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'length').enumerable is true
PASS Object.getOwnPropertyDescriptor(global, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 0).value is global[0]
PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 0).enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 0).configurable is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').value is 1
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').enumerable is true
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).value is document.getElementsByTagName('div')[0]
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).configurable is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).value is document.getElementsByClassName('pass')[0]
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).configurable is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').value is document.getElementsByClassName('pass').length
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').enumerable is true
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 'length').value is canvasPixelArray.length
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 'length').enumerable is true
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).value is canvasPixelArray[0]
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).configurable is false
PASS Object.getOwnPropertyDescriptor(select, 'length').value is select.length
PASS Object.getOwnPropertyDescriptor(select, 'length').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(select, 'length').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(select, 'length').enumerable is true
PASS Object.getOwnPropertyDescriptor(select, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(select, 0).value is select[0]
PASS Object.getOwnPropertyDescriptor(select, 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(select, 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(select, 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(select, 0).configurable is false
PASS Object.getOwnPropertyDescriptor(objectWithGetter, 'getter').get is getterFunc
PASS Object.getOwnPropertyDescriptor(objectWithGetter, 'getter').set is undefined
PASS Object.getOwnPropertyDescriptor(objectWithGetter, 'getter').hasOwnProperty('value') is false
PASS Object.getOwnPropertyDescriptor(objectWithGetter, 'getter').hasOwnProperty('writable') is false
PASS Object.getOwnPropertyDescriptor(objectWithGetter, 'getter').enumerable is true
PASS Object.getOwnPropertyDescriptor(objectWithGetter, 'getter').configurable is true
PASS Object.getOwnPropertyDescriptor(objectWithSetter, 'setter').get is undefined
PASS Object.getOwnPropertyDescriptor(objectWithSetter, 'setter').set is setterFunc
PASS Object.getOwnPropertyDescriptor(objectWithSetter, 'setter').hasOwnProperty('value') is false
PASS Object.getOwnPropertyDescriptor(objectWithSetter, 'setter').hasOwnProperty('writable') is false
PASS Object.getOwnPropertyDescriptor(objectWithSetter, 'setter').enumerable is true
PASS Object.getOwnPropertyDescriptor(objectWithSetter, 'setter').configurable is true
PASS Object.getOwnPropertyDescriptor(objectWithAccessor, 'accessor').get is getterFunc
PASS Object.getOwnPropertyDescriptor(objectWithAccessor, 'accessor').set is setterFunc
PASS Object.getOwnPropertyDescriptor(objectWithAccessor, 'accessor').hasOwnProperty('value') is false
PASS Object.getOwnPropertyDescriptor(objectWithAccessor, 'accessor').hasOwnProperty('writable') is false
PASS Object.getOwnPropertyDescriptor(objectWithAccessor, 'accessor').enumerable is true
PASS Object.getOwnPropertyDescriptor(objectWithAccessor, 'accessor').configurable is true
PASS Object.getOwnPropertyDescriptor(null) threw exception TypeError: Requested property descriptor of a value that is not an object..
PASS Object.getOwnPropertyDescriptor(undefined) threw exception TypeError: Requested property descriptor of a value that is not an object..
PASS Object.getOwnPropertyDescriptor(1) threw exception TypeError: Requested property descriptor of a value that is not an object..
PASS Object.getOwnPropertyDescriptor('') threw exception TypeError: Requested property descriptor of a value that is not an object..
PASS Object.getOwnPropertyDescriptor(true) threw exception TypeError: Requested property descriptor of a value that is not an object..
PASS Object.getOwnPropertyDescriptor(false) threw exception TypeError: Requested property descriptor of a value that is not an object..
Checking property ordering
PASS property is 'value'
PASS property is 'writable'
PASS property is 'enumerable'
PASS property is 'configurable'
PASS property is 'get'
PASS property is 'set'
PASS property is 'enumerable'
PASS property is 'configurable'
PASS property is 'get'
PASS property is 'set'
PASS property is 'enumerable'
PASS property is 'configurable'
PASS property is 'get'
PASS property is 'set'
PASS property is 'enumerable'
PASS property is 'configurable'
PASS successfullyParsed is true
TEST COMPLETE