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

Unified Diff: src/v8natives.js

Issue 391683002: Include symbol properties in Object.{create,defineProperties} (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed DebugPrint Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/symbols.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 5ffff2ecacd9f789d475595aa506c3093d20bfe4..7aea599de4c80711c268c8488e12d3122cf36da1 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1171,13 +1171,21 @@ function ObjectDefineProperty(obj, p, attributes) {
}
-function GetOwnEnumerablePropertyNames(properties) {
+function GetOwnEnumerablePropertyNames(object) {
var names = new InternalArray();
- for (var key in properties) {
- if (%HasOwnProperty(properties, key)) {
+ for (var key in object) {
+ if (%HasOwnProperty(object, key)) {
names.push(key);
}
}
+ // FLAG_harmony_symbols may be on, but symbols aren't included by for-in.
+ var symbols = ObjectGetOwnPropertyKeys(object, true);
+ for (var i in symbols) {
+ var symbol = symbols[i];
+ if (ObjectGetOwnPropertyDescriptor(object, symbol).enumerable) {
+ names.push(symbol);
+ }
+ }
return names;
}
« no previous file with comments | « no previous file | test/mjsunit/es6/symbols.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698