Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Issue 108083005: ES6: Add Object.getOwnPropertySymbols (Closed)

Created:
7 years ago by arv (Not doing code reviews)
Modified:
6 years, 11 months ago
Reviewers:
rossberg
CC:
v8-dev, sof
Visibility:
Public.

Description

ES6: Add Object.getOwnPropertySymbols http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.getownpropertysymbols This allows you to get the symbols used as property keys for an object. var object = {}; var sym = Symbol(); object[sym] = 42; assert(Object.getOwnPropertySymbols(object)[0] === sym); This is only available with --harmony-symbols BUG=v8:3049 R=rossberg@chromium.org, rossberg LOG=Y Committed: https://code.google.com/p/v8/source/detail?r=18520

Patch Set 1 #

Patch Set 2 : Make sure to not include private symbols #

Patch Set 3 : reitveld error #

Total comments: 20

Patch Set 4 : Add macro and expand test #

Patch Set 5 : fix private test #

Patch Set 6 : Do the filtering in the runtime function #

Total comments: 12

Patch Set 7 : Update the filter bitmask #

Patch Set 8 : rename a var #

Total comments: 5

Patch Set 9 : Remove FilterKeyNames from js and inverse filter check #

Total comments: 2

Patch Set 10 : Fix issues with debug mode #

Patch Set 11 : Put back use strict #

Total comments: 2

Patch Set 12 : Comment and formatting based on code review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -49 lines) Patch
M src/macros.py View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 0 comments Download
M src/mirror-debugger.js View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 4 chunks +21 lines, -3 lines 0 comments Download
M src/property-details.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -3 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M src/symbol.js View 1 2 3 4 5 6 7 8 9 10 2 chunks +23 lines, -0 lines 0 comments Download
M src/v8natives.js View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +48 lines, -35 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -3 lines 0 comments Download
M test/mjsunit/harmony/symbols.js View 1 2 3 4 4 chunks +52 lines, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
arv (Not doing code reviews)
A few questions 1. Right now this handles interceptors using symbols. Is that even possible? ...
7 years ago (2013-12-09 18:07:29 UTC) #1
arv (Not doing code reviews)
Ouch, this leaks private symbols. Let me fix that.
7 years ago (2013-12-09 19:46:41 UTC) #2
rossberg
https://codereview.chromium.org/108083005/diff/40001/src/v8natives.js File src/v8natives.js (right): https://codereview.chromium.org/108083005/diff/40001/src/v8natives.js#newcode1041 src/v8natives.js:1041: function GetSymbolsInArray(propertyKeys) { Nit: perhaps call this FilterPublicSymbols? https://codereview.chromium.org/108083005/diff/40001/src/v8natives.js#newcode1045 ...
7 years ago (2013-12-10 10:39:53 UTC) #3
arv (Not doing code reviews)
I didn't have time to do the refactoring of the runtime function yet. I'll get ...
7 years ago (2013-12-11 00:16:26 UTC) #4
arv (Not doing code reviews)
PTAL https://codereview.chromium.org/108083005/diff/90001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/108083005/diff/90001/src/runtime.cc#newcode5920 src/runtime.cc:5920: for (int i = 0; i < res->length(); ...
7 years ago (2013-12-11 23:51:11 UTC) #5
rossberg
https://codereview.chromium.org/108083005/diff/40001/test/mjsunit/harmony/symbols.js File test/mjsunit/harmony/symbols.js (right): https://codereview.chromium.org/108083005/diff/40001/test/mjsunit/harmony/symbols.js#newcode305 test/mjsunit/harmony/symbols.js:305: assertEquals("symbol", typeof syms[i]) On 2013/12/11 00:16:26, arv wrote: > ...
7 years ago (2013-12-12 15:37:59 UTC) #6
arv (Not doing code reviews)
https://codereview.chromium.org/108083005/diff/90001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/108083005/diff/90001/src/runtime.cc#newcode5861 src/runtime.cc:5861: if ((key_type & Runtime::PROPERTY_KEY_SYMBOL) && On 2013/12/12 15:37:59, rossberg ...
7 years ago (2013-12-12 16:06:16 UTC) #7
arv (Not doing code reviews)
PTAL https://codereview.chromium.org/108083005/diff/90001/src/macros.py File src/macros.py (right): https://codereview.chromium.org/108083005/diff/90001/src/macros.py#newcode162 src/macros.py:162: macro IS_PRIVATE(arg) = (%SymbolIsPrivate(arg)); On 2013/12/12 15:37:59, rossberg ...
7 years ago (2013-12-16 21:51:20 UTC) #8
rossberg
Looking quite good now, just two more comments. https://codereview.chromium.org/108083005/diff/130001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/108083005/diff/130001/src/objects.cc#newcode5915 src/objects.cc:5915: if ...
7 years ago (2013-12-18 16:50:12 UTC) #9
arv (Not doing code reviews)
PTAL https://codereview.chromium.org/108083005/diff/130001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/108083005/diff/130001/src/objects.cc#newcode5915 src/objects.cc:5915: if (key->IsSymbol()) { On 2013/12/18 16:50:12, rossberg wrote: ...
7 years ago (2013-12-18 18:07:12 UTC) #10
arv (Not doing code reviews)
https://codereview.chromium.org/108083005/diff/150001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/108083005/diff/150001/src/objects.cc#newcode5915 src/objects.cc:5915: if ((filter & SYMBOLIC) && key->IsSymbol()) { One option ...
7 years ago (2013-12-18 18:10:02 UTC) #11
rossberg
LGTM I'll try to land once the tree allows it (given the long line of ...
7 years ago (2013-12-19 10:28:04 UTC) #12
rossberg
Hm, I get plenty of assertion failures when running the test suite on a debug ...
7 years ago (2013-12-20 12:16:56 UTC) #13
arv (Not doing code reviews)
PTAL Here are the issues that was causing debug failures. 1. I added an assert ...
6 years, 11 months ago (2014-01-06 23:41:50 UTC) #14
rossberg
LGTM with small nits. (Next time please upload a suitable diff if you rebase. ;) ...
6 years, 11 months ago (2014-01-09 12:01:27 UTC) #15
arv (Not doing code reviews)
PTAL Sorry about the ugly interdiff.
6 years, 11 months ago (2014-01-09 14:16:09 UTC) #16
rossberg
6 years, 11 months ago (2014-01-09 15:57:43 UTC) #17
Message was sent while issue was closed.
Committed patchset #12 manually as r18520 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698