[Webkit-unassigned] [Bug 142943] ES6: Computed Properties should always produce string keys, not numeric indexes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Mar 21 19:29:37 PDT 2015


Joseph Pecoraro <joepeck at webkit.org> changed:

           What    |Removed                     |Added
                 CC|                            |joepeck at webkit.org

--- Comment #1 from Joseph Pecoraro <joepeck at webkit.org> ---
So it seems "op_put_by_val_direct" is used in lots of places:

  - computed properties (PropertyListNode::emitBytecode)
  - array literal with spread (ArrayNode::emitBytecode)
  - and any put by val used by built-ins

The implementation of the op code does special case integer indexes.

I'm not sure we can reconcile the difference that only computed properties has with the generic put by value case.

It is worth keeping in mind that we will soon have computed getter/setter names, that will also have this same to string conversion of the property.

  - It seems wasteful to extend the existing opcode because it can be common
  - It seems wasteful to add a new op code just for this
    - but it would be easy (just call JSValue::toPropertyKey)

I don't see any existing opcodes that would do exactly what we want here without changes. The closest is op_to_index_string (assumes int property provided).

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150322/1594258c/attachment-0002.html>

More information about the webkit-unassigned mailing list