haikuwebkit/LayoutTests/js/array-defineOwnProperty-exp...

45 lines
4.6 KiB
Plaintext
Raw Permalink Normal View History

https://bugs.webkit.org/show_bug.cgi?id=75789 defineOwnProperty not implemented for Array objects Reviewed by Sam Weinig. Source/JavaScriptCore: Implements support for getter/setter & non-default attribute properties on arrays, by forcing them into a dictionary-like 'SparseMode'. This fixes ~300 test-262 test failures. * JavaScriptCore.exp: - Updated exports. * dfg/DFGOperations.cpp: - JSArray::pop now requires an exec state. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncPop): - JSArray::pop now requires an exec state. * runtime/JSArray.cpp: (JSC::SparseArrayValueMap::add): - Add a potentially empty entry into the map. (JSC::SparseArrayValueMap::put): - Changed to call setter. (JSC::SparseArrayEntry::get): - calls getters. (JSC::SparseArrayEntry::getNonSparseMode): - does not call getters. (JSC::JSArray::enterSparseMode): - Convert into 'SparseMode' - removes the vectors, don't allow it to be recreated. (JSC::JSArray::putDescriptor): - Create a numeric property based on a descriptor. (JSC::sameValue): - See ES5.1 9.12. (JSC::reject): - Helper for the [[DefineOwnProperty]] algorithm. (JSC::JSArray::defineOwnNumericProperty): - Define an indexed property on an array object. (JSC::JSArray::setLengthWritable): - Marks the length read-only, enters SparseMode as necessary. (JSC::JSArray::defineOwnProperty): - Defines either an indexed property or 'length' on an array object. (JSC::JSArray::getOwnPropertySlotByIndex): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::getOwnPropertyDescriptor): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::put): - Pass strict mode flag to setLength. (JSC::JSArray::putByIndex): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::putByIndexBeyondVectorLength): - Pass exec to SparseArrayValueMap::put. (JSC::JSArray::deletePropertyByIndex): - Do not allow deletion of non-configurable properties. (JSC::compareKeysForQSort): - used in implementation of getOwnPropertyNames. (JSC::JSArray::getOwnPropertyNames): - Properties in the sparse map should be iterated in order. (JSC::JSArray::setLength): - Updated to take a 'shouldThrow' flag, return a result indicating error. (JSC::JSArray::pop): - pop should throw an error if length is not writable, even if the array is empty. (JSC::JSArray::push): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::sort): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). (JSC::JSArray::compactForSorting): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). * runtime/JSArray.h: (JSC::SparseArrayValueMap::lengthIsReadOnly): - Check if the length is read only. (JSC::SparseArrayValueMap::setLengthIsReadOnly): - Mark the length as read only. (JSC::SparseArrayValueMap::find): - Moved into header. (JSC::JSArray::isLengthWritable): - Wraps SparseArrayValueMap::lengthIsReadOnly. * runtime/JSObject.cpp: (JSC::JSObject::defineOwnProperty): - Should be returning the result of putDescriptor. * runtime/PropertyDescriptor.cpp: (JSC::PropertyDescriptor::attributesOverridingCurrent): - Added attributesOverridingCurrent - this should probably be merged with attributesWithOverride. * runtime/PropertyDescriptor.h: - Added attributesOverridingCurrent. LayoutTests: * fast/js/array-defineOwnProperty-expected.txt: Added. * fast/js/array-defineOwnProperty.html: Added. * fast/js/script-tests/array-defineOwnProperty.js: Added. - Added tests for array properties with accessors & non-defulat attributes. * fast/js/mozilla/strict/15.4.4.6-expected.txt: * fast/js/mozilla/strict/8.12.5-expected.txt: * ietestcenter/Javascript/15.4.4.14-9-a-12-expected.txt: * ietestcenter/Javascript/15.4.4.15-8-a-12-expected.txt: - Check in passing results. Canonical link: https://commits.webkit.org/92684@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-09 21:56:46 +00:00
This test checks the behavior of [[DefineOwnProperty]] applied to Array objects (see ES5.1 15.4.5.1).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.defineProperty([], 'x', { get:function(){return true;} }).x is true
PASS Object.defineProperty([], 'length', { value: 1 }).length is 1
PASS var a = Object.defineProperty([], 'length', { writable: false }); a[1] = 1; a.length is 0
Source/JavaScriptCore: Do not allow Array length to be set if it is non-configurable https://bugs.webkit.org/show_bug.cgi?id=75935 Reviewed by Sam Weinig. Do not allow Array length to be set if it is non-configurable, and if the new length is less than the old length then intervening properties should removed in reverse order. Removal of properties should cease if an intervening indexed property being removed is non-configurable. * JavaScriptCore.exp: - Removed export for setLength. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncConcat): - JSArray::setLength now takes an ExecState* (JSC::arrayProtoFuncSlice): - JSArray::setLength now takes an ExecState* * runtime/JSArray.cpp: (JSC::JSArray::defineOwnProperty): - JSArray::setLength now takes an ExecState* (JSC::JSArray::put): - JSArray::setLength now takes an ExecState* (JSC::compareKeysForQSort): - Keys extracted from the map can be stored as unsigneds. (JSC::JSArray::getOwnPropertyNames): - Keys extracted from the map can be stored as unsigneds. (JSC::JSArray::setLength): - Check lengthIsReadOnly(), rather than copying the entire map to iterate over to determine which keys to remove, instead just copy the keys from the map to a Vector. When inSparseMode sort the keys in the Vector so that we can remove properties in reverse order. * runtime/JSArray.h: - JSArray::setLength now takes an ExecState* Source/WebCore: Do not allow Array length to be set if it is non-configurable https://bugs.webkit.org/show_bug.cgi?id=75935 Reviewed by Sam Weinig. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::deserialize): - remove unnecessary call to JSArray::setLength. LayoutTests: rebaselining some canvas images https://bugs.webkit.org/show_bug.cgi?id=75552 Patch by Elliot Poger <epoger@google.com> on 2012-01-10 Reviewed by Ryosuke Niwa. * platform/chromium-gpu-linux/fast/canvas/canvas-text-baseline-expected.png: * platform/chromium-gpu-linux/fast/canvas/quadraticCurveTo-expected.png: * platform/chromium-gpu-mac/fast/canvas/canvas-text-baseline-expected.png: Added. * platform/chromium-gpu-mac/fast/canvas/quadraticCurveTo-expected.png: Added. * platform/chromium-gpu-win/fast/canvas/canvas-text-baseline-expected.png: * platform/chromium-gpu-win/fast/canvas/quadraticCurveTo-expected.png: * platform/chromium-mac-leopard/fast/canvas/quadraticCurveTo-expected.png: Added. * platform/chromium-mac-snowleopard/fast/canvas/canvas-lineWidth-expected.txt: Added. * platform/chromium-mac-snowleopard/fast/canvas/canvas-text-baseline-expected.png: Added. * platform/chromium-mac-snowleopard/fast/canvas/quadraticCurveTo-expected.png: Added. * platform/chromium/test_expectations.txt: Canonical link: https://commits.webkit.org/92782@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-10 19:27:46 +00:00
PASS var a = Object.defineProperty([], 'length', { writable: false }); a.length = 1; a.length is 0
PASS var a = Object.defineProperty([], 'length', {}); a.length = 1; a.length is 1
https://bugs.webkit.org/show_bug.cgi?id=75789 defineOwnProperty not implemented for Array objects Reviewed by Sam Weinig. Source/JavaScriptCore: Implements support for getter/setter & non-default attribute properties on arrays, by forcing them into a dictionary-like 'SparseMode'. This fixes ~300 test-262 test failures. * JavaScriptCore.exp: - Updated exports. * dfg/DFGOperations.cpp: - JSArray::pop now requires an exec state. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncPop): - JSArray::pop now requires an exec state. * runtime/JSArray.cpp: (JSC::SparseArrayValueMap::add): - Add a potentially empty entry into the map. (JSC::SparseArrayValueMap::put): - Changed to call setter. (JSC::SparseArrayEntry::get): - calls getters. (JSC::SparseArrayEntry::getNonSparseMode): - does not call getters. (JSC::JSArray::enterSparseMode): - Convert into 'SparseMode' - removes the vectors, don't allow it to be recreated. (JSC::JSArray::putDescriptor): - Create a numeric property based on a descriptor. (JSC::sameValue): - See ES5.1 9.12. (JSC::reject): - Helper for the [[DefineOwnProperty]] algorithm. (JSC::JSArray::defineOwnNumericProperty): - Define an indexed property on an array object. (JSC::JSArray::setLengthWritable): - Marks the length read-only, enters SparseMode as necessary. (JSC::JSArray::defineOwnProperty): - Defines either an indexed property or 'length' on an array object. (JSC::JSArray::getOwnPropertySlotByIndex): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::getOwnPropertyDescriptor): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::put): - Pass strict mode flag to setLength. (JSC::JSArray::putByIndex): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::putByIndexBeyondVectorLength): - Pass exec to SparseArrayValueMap::put. (JSC::JSArray::deletePropertyByIndex): - Do not allow deletion of non-configurable properties. (JSC::compareKeysForQSort): - used in implementation of getOwnPropertyNames. (JSC::JSArray::getOwnPropertyNames): - Properties in the sparse map should be iterated in order. (JSC::JSArray::setLength): - Updated to take a 'shouldThrow' flag, return a result indicating error. (JSC::JSArray::pop): - pop should throw an error if length is not writable, even if the array is empty. (JSC::JSArray::push): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::sort): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). (JSC::JSArray::compactForSorting): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). * runtime/JSArray.h: (JSC::SparseArrayValueMap::lengthIsReadOnly): - Check if the length is read only. (JSC::SparseArrayValueMap::setLengthIsReadOnly): - Mark the length as read only. (JSC::SparseArrayValueMap::find): - Moved into header. (JSC::JSArray::isLengthWritable): - Wraps SparseArrayValueMap::lengthIsReadOnly. * runtime/JSObject.cpp: (JSC::JSObject::defineOwnProperty): - Should be returning the result of putDescriptor. * runtime/PropertyDescriptor.cpp: (JSC::PropertyDescriptor::attributesOverridingCurrent): - Added attributesOverridingCurrent - this should probably be merged with attributesWithOverride. * runtime/PropertyDescriptor.h: - Added attributesOverridingCurrent. LayoutTests: * fast/js/array-defineOwnProperty-expected.txt: Added. * fast/js/array-defineOwnProperty.html: Added. * fast/js/script-tests/array-defineOwnProperty.js: Added. - Added tests for array properties with accessors & non-defulat attributes. * fast/js/mozilla/strict/15.4.4.6-expected.txt: * fast/js/mozilla/strict/8.12.5-expected.txt: * ietestcenter/Javascript/15.4.4.14-9-a-12-expected.txt: * ietestcenter/Javascript/15.4.4.15-8-a-12-expected.txt: - Check in passing results. Canonical link: https://commits.webkit.org/92684@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-09 21:56:46 +00:00
PASS Object.defineProperty([], 'length', { get:function(){return true;} }) threw exception TypeError: Attempting to change access mechanism for an unconfigurable property..
PASS Object.defineProperty([], 'length', { enumerable: true }) threw exception TypeError: Attempting to change enumerable attribute of unconfigurable property..
PASS Object.defineProperty([], 'length', { configurable: true }) threw exception TypeError: Attempting to change configurable attribute of unconfigurable property..
PASS Object.defineProperty(Object.defineProperty([], 'length', { writable: false }), 'length', { writable: true }) threw exception TypeError: Attempting to change writable attribute of unconfigurable property..
PASS var a = Object.defineProperty([], '0', { value: 42 }); a[0] is 42
PASS var a = Object.defineProperty([42], '0', { writable: false }); a[0] = 1; a[0] is 42
PASS var a = Object.defineProperty([42], '0', { enumerable: false }); a[0] + Object.keys(a).length is 42
Source/JavaScriptCore: Do not allow Array length to be set if it is non-configurable https://bugs.webkit.org/show_bug.cgi?id=75935 Reviewed by Sam Weinig. Do not allow Array length to be set if it is non-configurable, and if the new length is less than the old length then intervening properties should removed in reverse order. Removal of properties should cease if an intervening indexed property being removed is non-configurable. * JavaScriptCore.exp: - Removed export for setLength. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncConcat): - JSArray::setLength now takes an ExecState* (JSC::arrayProtoFuncSlice): - JSArray::setLength now takes an ExecState* * runtime/JSArray.cpp: (JSC::JSArray::defineOwnProperty): - JSArray::setLength now takes an ExecState* (JSC::JSArray::put): - JSArray::setLength now takes an ExecState* (JSC::compareKeysForQSort): - Keys extracted from the map can be stored as unsigneds. (JSC::JSArray::getOwnPropertyNames): - Keys extracted from the map can be stored as unsigneds. (JSC::JSArray::setLength): - Check lengthIsReadOnly(), rather than copying the entire map to iterate over to determine which keys to remove, instead just copy the keys from the map to a Vector. When inSparseMode sort the keys in the Vector so that we can remove properties in reverse order. * runtime/JSArray.h: - JSArray::setLength now takes an ExecState* Source/WebCore: Do not allow Array length to be set if it is non-configurable https://bugs.webkit.org/show_bug.cgi?id=75935 Reviewed by Sam Weinig. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::deserialize): - remove unnecessary call to JSArray::setLength. LayoutTests: rebaselining some canvas images https://bugs.webkit.org/show_bug.cgi?id=75552 Patch by Elliot Poger <epoger@google.com> on 2012-01-10 Reviewed by Ryosuke Niwa. * platform/chromium-gpu-linux/fast/canvas/canvas-text-baseline-expected.png: * platform/chromium-gpu-linux/fast/canvas/quadraticCurveTo-expected.png: * platform/chromium-gpu-mac/fast/canvas/canvas-text-baseline-expected.png: Added. * platform/chromium-gpu-mac/fast/canvas/quadraticCurveTo-expected.png: Added. * platform/chromium-gpu-win/fast/canvas/canvas-text-baseline-expected.png: * platform/chromium-gpu-win/fast/canvas/quadraticCurveTo-expected.png: * platform/chromium-mac-leopard/fast/canvas/quadraticCurveTo-expected.png: Added. * platform/chromium-mac-snowleopard/fast/canvas/canvas-lineWidth-expected.txt: Added. * platform/chromium-mac-snowleopard/fast/canvas/canvas-text-baseline-expected.png: Added. * platform/chromium-mac-snowleopard/fast/canvas/quadraticCurveTo-expected.png: Added. * platform/chromium/test_expectations.txt: Canonical link: https://commits.webkit.org/92782@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-10 19:27:46 +00:00
PASS var a = Object.defineProperty([42], '0', { configurable: false }); a.length = 0; a[0] is 42
https://bugs.webkit.org/show_bug.cgi?id=75789 defineOwnProperty not implemented for Array objects Reviewed by Sam Weinig. Source/JavaScriptCore: Implements support for getter/setter & non-default attribute properties on arrays, by forcing them into a dictionary-like 'SparseMode'. This fixes ~300 test-262 test failures. * JavaScriptCore.exp: - Updated exports. * dfg/DFGOperations.cpp: - JSArray::pop now requires an exec state. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncPop): - JSArray::pop now requires an exec state. * runtime/JSArray.cpp: (JSC::SparseArrayValueMap::add): - Add a potentially empty entry into the map. (JSC::SparseArrayValueMap::put): - Changed to call setter. (JSC::SparseArrayEntry::get): - calls getters. (JSC::SparseArrayEntry::getNonSparseMode): - does not call getters. (JSC::JSArray::enterSparseMode): - Convert into 'SparseMode' - removes the vectors, don't allow it to be recreated. (JSC::JSArray::putDescriptor): - Create a numeric property based on a descriptor. (JSC::sameValue): - See ES5.1 9.12. (JSC::reject): - Helper for the [[DefineOwnProperty]] algorithm. (JSC::JSArray::defineOwnNumericProperty): - Define an indexed property on an array object. (JSC::JSArray::setLengthWritable): - Marks the length read-only, enters SparseMode as necessary. (JSC::JSArray::defineOwnProperty): - Defines either an indexed property or 'length' on an array object. (JSC::JSArray::getOwnPropertySlotByIndex): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::getOwnPropertyDescriptor): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::put): - Pass strict mode flag to setLength. (JSC::JSArray::putByIndex): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::putByIndexBeyondVectorLength): - Pass exec to SparseArrayValueMap::put. (JSC::JSArray::deletePropertyByIndex): - Do not allow deletion of non-configurable properties. (JSC::compareKeysForQSort): - used in implementation of getOwnPropertyNames. (JSC::JSArray::getOwnPropertyNames): - Properties in the sparse map should be iterated in order. (JSC::JSArray::setLength): - Updated to take a 'shouldThrow' flag, return a result indicating error. (JSC::JSArray::pop): - pop should throw an error if length is not writable, even if the array is empty. (JSC::JSArray::push): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::sort): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). (JSC::JSArray::compactForSorting): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). * runtime/JSArray.h: (JSC::SparseArrayValueMap::lengthIsReadOnly): - Check if the length is read only. (JSC::SparseArrayValueMap::setLengthIsReadOnly): - Mark the length as read only. (JSC::SparseArrayValueMap::find): - Moved into header. (JSC::JSArray::isLengthWritable): - Wraps SparseArrayValueMap::lengthIsReadOnly. * runtime/JSObject.cpp: (JSC::JSObject::defineOwnProperty): - Should be returning the result of putDescriptor. * runtime/PropertyDescriptor.cpp: (JSC::PropertyDescriptor::attributesOverridingCurrent): - Added attributesOverridingCurrent - this should probably be merged with attributesWithOverride. * runtime/PropertyDescriptor.h: - Added attributesOverridingCurrent. LayoutTests: * fast/js/array-defineOwnProperty-expected.txt: Added. * fast/js/array-defineOwnProperty.html: Added. * fast/js/script-tests/array-defineOwnProperty.js: Added. - Added tests for array properties with accessors & non-defulat attributes. * fast/js/mozilla/strict/15.4.4.6-expected.txt: * fast/js/mozilla/strict/8.12.5-expected.txt: * ietestcenter/Javascript/15.4.4.14-9-a-12-expected.txt: * ietestcenter/Javascript/15.4.4.15-8-a-12-expected.txt: - Check in passing results. Canonical link: https://commits.webkit.org/92684@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-09 21:56:46 +00:00
PASS var foo = 0; Object.defineProperty([], '0', { set:function(x){foo = x;} })[0] = 42; foo is 42
PASS Object.defineProperty([], '0', { get:function(){return true;} })[0] is true
PASS Object.defineProperty(Object.defineProperty([true], '0', { configurable:true, writable: false }), '0', { writable: true })[0] is true
PASS Object.defineProperty(Object.defineProperty([true], '0', { configurable:false, writable: false }), '0', { writable: true })[0] threw exception TypeError: Attempting to change writable attribute of unconfigurable property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 1, writable:true }), '0', { value: 2 })[0] is 2
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 1 }), '0', { value: 1 })[0] is 1
PASS Object.defineProperty(Object.defineProperty([], '0', { value: Number.NaN }), '0', { value: -Number.NaN })[0] is Number.NaN
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 'okay'.substring(0,2) }), '0', { value: 'not ok'.substring(4,6) })[0] is "ok"
PASS Object.defineProperty(Object.defineProperty([], '0', { value: true }), '0', { value: true })[0] is true
PASS Object.defineProperty(Object.defineProperty([], '0', { value: false }), '0', { value: false })[0] is false
PASS Object.defineProperty(Object.defineProperty([], '0', { value: null }), '0', { value: null })[0] is null
PASS Object.defineProperty(Object.defineProperty([], '0', { value: undefined }), '0', { value: undefined })[0] is undefined
PASS Object.defineProperty(Object.defineProperty([], '0', { value: Math }), '0', { value: Math })[0] is Math
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 1 }), '0', { value: 2 })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 'okay' }), '0', { value: 'not ok' })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: true }), '0', { value: false })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: false }), '0', { value: true })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: Math }), '0', { value: Object })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: null }), '0', { value: undefined })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS Object.defineProperty(Object.defineProperty([], '0', { value: undefined }), '0', { value: null })[0] threw exception TypeError: Attempting to change value of a readonly property..
PASS arrObj[0] = 42; arrObj.set; is true
PASS arrObj[1] = true; arrObj[1]; is true
https://bugs.webkit.org/show_bug.cgi?id=75789 defineOwnProperty not implemented for Array objects Reviewed by Sam Weinig. Source/JavaScriptCore: Implements support for getter/setter & non-default attribute properties on arrays, by forcing them into a dictionary-like 'SparseMode'. This fixes ~300 test-262 test failures. * JavaScriptCore.exp: - Updated exports. * dfg/DFGOperations.cpp: - JSArray::pop now requires an exec state. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncPop): - JSArray::pop now requires an exec state. * runtime/JSArray.cpp: (JSC::SparseArrayValueMap::add): - Add a potentially empty entry into the map. (JSC::SparseArrayValueMap::put): - Changed to call setter. (JSC::SparseArrayEntry::get): - calls getters. (JSC::SparseArrayEntry::getNonSparseMode): - does not call getters. (JSC::JSArray::enterSparseMode): - Convert into 'SparseMode' - removes the vectors, don't allow it to be recreated. (JSC::JSArray::putDescriptor): - Create a numeric property based on a descriptor. (JSC::sameValue): - See ES5.1 9.12. (JSC::reject): - Helper for the [[DefineOwnProperty]] algorithm. (JSC::JSArray::defineOwnNumericProperty): - Define an indexed property on an array object. (JSC::JSArray::setLengthWritable): - Marks the length read-only, enters SparseMode as necessary. (JSC::JSArray::defineOwnProperty): - Defines either an indexed property or 'length' on an array object. (JSC::JSArray::getOwnPropertySlotByIndex): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::getOwnPropertyDescriptor): - Updated to correctly handle accessor descriptors & attributes. (JSC::JSArray::put): - Pass strict mode flag to setLength. (JSC::JSArray::putByIndex): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::putByIndexBeyondVectorLength): - Pass exec to SparseArrayValueMap::put. (JSC::JSArray::deletePropertyByIndex): - Do not allow deletion of non-configurable properties. (JSC::compareKeysForQSort): - used in implementation of getOwnPropertyNames. (JSC::JSArray::getOwnPropertyNames): - Properties in the sparse map should be iterated in order. (JSC::JSArray::setLength): - Updated to take a 'shouldThrow' flag, return a result indicating error. (JSC::JSArray::pop): - pop should throw an error if length is not writable, even if the array is empty. (JSC::JSArray::push): - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. (JSC::JSArray::sort): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). (JSC::JSArray::compactForSorting): - Changed 'get' to 'getNonSparseMode' (can't be getters to call). * runtime/JSArray.h: (JSC::SparseArrayValueMap::lengthIsReadOnly): - Check if the length is read only. (JSC::SparseArrayValueMap::setLengthIsReadOnly): - Mark the length as read only. (JSC::SparseArrayValueMap::find): - Moved into header. (JSC::JSArray::isLengthWritable): - Wraps SparseArrayValueMap::lengthIsReadOnly. * runtime/JSObject.cpp: (JSC::JSObject::defineOwnProperty): - Should be returning the result of putDescriptor. * runtime/PropertyDescriptor.cpp: (JSC::PropertyDescriptor::attributesOverridingCurrent): - Added attributesOverridingCurrent - this should probably be merged with attributesWithOverride. * runtime/PropertyDescriptor.h: - Added attributesOverridingCurrent. LayoutTests: * fast/js/array-defineOwnProperty-expected.txt: Added. * fast/js/array-defineOwnProperty.html: Added. * fast/js/script-tests/array-defineOwnProperty.js: Added. - Added tests for array properties with accessors & non-defulat attributes. * fast/js/mozilla/strict/15.4.4.6-expected.txt: * fast/js/mozilla/strict/8.12.5-expected.txt: * ietestcenter/Javascript/15.4.4.14-9-a-12-expected.txt: * ietestcenter/Javascript/15.4.4.15-8-a-12-expected.txt: - Check in passing results. Canonical link: https://commits.webkit.org/92684@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-09 21:56:46 +00:00
PASS successfullyParsed is true
TEST COMPLETE