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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/es6/symbols.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in runtime.js: 6 // in runtime.js:
7 // var $Object = global.Object; 7 // var $Object = global.Object;
8 // var $Boolean = global.Boolean; 8 // var $Boolean = global.Boolean;
9 // var $Number = global.Number; 9 // var $Number = global.Number;
10 // var $Function = global.Function; 10 // var $Function = global.Function;
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 desc = descObj; 1164 desc = descObj;
1165 */ 1165 */
1166 } else { 1166 } else {
1167 var desc = ToPropertyDescriptor(attributes); 1167 var desc = ToPropertyDescriptor(attributes);
1168 DefineOwnProperty(obj, name, desc, true); 1168 DefineOwnProperty(obj, name, desc, true);
1169 } 1169 }
1170 return obj; 1170 return obj;
1171 } 1171 }
1172 1172
1173 1173
1174 function GetOwnEnumerablePropertyNames(properties) { 1174 function GetOwnEnumerablePropertyNames(object) {
1175 var names = new InternalArray(); 1175 var names = new InternalArray();
1176 for (var key in properties) { 1176 for (var key in object) {
1177 if (%HasOwnProperty(properties, key)) { 1177 if (%HasOwnProperty(object, key)) {
1178 names.push(key); 1178 names.push(key);
1179 } 1179 }
1180 } 1180 }
1181 // FLAG_harmony_symbols may be on, but symbols aren't included by for-in.
1182 var symbols = ObjectGetOwnPropertyKeys(object, true);
1183 for (var i in symbols) {
1184 var symbol = symbols[i];
1185 if (ObjectGetOwnPropertyDescriptor(object, symbol).enumerable) {
1186 names.push(symbol);
1187 }
1188 }
1181 return names; 1189 return names;
1182 } 1190 }
1183 1191
1184 1192
1185 // ES5 section 15.2.3.7. 1193 // ES5 section 15.2.3.7.
1186 function ObjectDefineProperties(obj, properties) { 1194 function ObjectDefineProperties(obj, properties) {
1187 if (!IS_SPEC_OBJECT(obj)) { 1195 if (!IS_SPEC_OBJECT(obj)) {
1188 throw MakeTypeError("called_on_non_object", ["Object.defineProperties"]); 1196 throw MakeTypeError("called_on_non_object", ["Object.defineProperties"]);
1189 } 1197 }
1190 var props = ToObject(properties); 1198 var props = ToObject(properties);
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 %SetCode($Function, FunctionConstructor); 1858 %SetCode($Function, FunctionConstructor);
1851 %AddProperty($Function.prototype, "constructor", $Function, DONT_ENUM); 1859 %AddProperty($Function.prototype, "constructor", $Function, DONT_ENUM);
1852 1860
1853 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1861 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1854 "bind", FunctionBind, 1862 "bind", FunctionBind,
1855 "toString", FunctionToString 1863 "toString", FunctionToString
1856 )); 1864 ));
1857 } 1865 }
1858 1866
1859 SetUpFunction(); 1867 SetUpFunction();
OLDNEW
« 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