Bug 80217 - Split JSArray's [[Put]] & [[DefineOwnProperty]] traps.
Summary: Split JSArray's [[Put]] & [[DefineOwnProperty]] traps.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-03 17:39 PST by Gavin Barraclough
Modified: 2012-03-03 21:56 PST (History)
1 user (show)

See Also:


Attachments
Fix (13.09 KB, patch)
2012-03-03 17:42 PST, Gavin Barraclough
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2012-03-03 17:39:53 PST
putByIndex() provides similar behavior to put(), but for indexed property names.  Many places in ArrayPrototype call putByIndex() where they really mean to call [[DefineOwnProperty]].  This is only okay due to a bug – putByIndex should be calling numeric accessors (& respecting numeric read only properties) on the prototype chain, but isn't.  Add a new putDirectIndex (matching JSObject's putDirect* methods), to correctly provide a fast [[DefineOwnProperty]] interface.
Comment 1 Gavin Barraclough 2012-03-03 17:42:26 PST
Created attachment 130012 [details]
Fix

No new tests – this does not yet change behavior (errors were not reachable, since ArrayPrototype is always creating new properties).
Comment 2 WebKit Review Bot 2012-03-03 17:45:26 PST
Attachment 130012 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1
Source/JavaScriptCore/runtime/JSArray.h:168:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Source/JavaScriptCore/runtime/JSArray.h:298:  The parameter name "exec" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/JavaScriptCore/runtime/JSArray.h:298:  The parameter name "value" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Gavin Barraclough 2012-03-03 21:56:46 PST
Fixed in r109673