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

Side by Side Diff: src/v8natives.js

Issue 1094323005: [es6] Map/Set size getter should have "get size" name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | test/mjsunit/es6/built-in-accessor-names.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 28 matching lines...) Expand all
39 %FunctionRemovePrototype(f); 39 %FunctionRemovePrototype(f);
40 %SetNativeFlag(f); 40 %SetNativeFlag(f);
41 } 41 }
42 42
43 43
44 // Helper function to install a getter-only accessor property. 44 // Helper function to install a getter-only accessor property.
45 function InstallGetter(object, name, getter, attributes) { 45 function InstallGetter(object, name, getter, attributes) {
46 if (typeof attributes == "undefined") { 46 if (typeof attributes == "undefined") {
47 attributes = DONT_ENUM; 47 attributes = DONT_ENUM;
48 } 48 }
49 %FunctionSetName(getter, name); 49 %FunctionSetName(getter, `get ${
caitp (gmail) 2015/04/23 19:23:45 templates makes it look more readable, but remembe
arv (Not doing code reviews) 2015/04/23 19:51:53 Changed to +. It does not get too ugly.
50 IS_SYMBOL(name) ? `[${%SymbolDescription(name)}]` : name}`);
50 %FunctionRemovePrototype(getter); 51 %FunctionRemovePrototype(getter);
51 %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes); 52 %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes);
52 %SetNativeFlag(getter); 53 %SetNativeFlag(getter);
53 } 54 }
54 55
55 56
56 // Helper function to install a getter/setter accessor property. 57 // Helper function to install a getter/setter accessor property.
57 function InstallGetterSetter(object, name, getter, setter) { 58 function InstallGetterSetter(object, name, getter, setter) {
58 %FunctionSetName(getter, name); 59 var functionName = IS_SYMBOL(name) ? `[${%SymbolDescription(name)}]` : name;
59 %FunctionSetName(setter, name); 60 %FunctionSetName(getter, `get ${functionName}`);
61 %FunctionSetName(setter, `set ${functionName}`);
60 %FunctionRemovePrototype(getter); 62 %FunctionRemovePrototype(getter);
61 %FunctionRemovePrototype(setter); 63 %FunctionRemovePrototype(setter);
62 %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM); 64 %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM);
63 %SetNativeFlag(getter); 65 %SetNativeFlag(getter);
64 %SetNativeFlag(setter); 66 %SetNativeFlag(setter);
65 } 67 }
66 68
67 69
68 // Helper function for installing constant properties on objects. 70 // Helper function for installing constant properties on objects.
69 function InstallConstants(object, constants) { 71 function InstallConstants(object, constants) {
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1896 }
1895 if (!IS_SPEC_FUNCTION(method)) { 1897 if (!IS_SPEC_FUNCTION(method)) {
1896 throw MakeTypeError(kNotIterable, obj); 1898 throw MakeTypeError(kNotIterable, obj);
1897 } 1899 }
1898 var iterator = %_CallFunction(obj, method); 1900 var iterator = %_CallFunction(obj, method);
1899 if (!IS_SPEC_OBJECT(iterator)) { 1901 if (!IS_SPEC_OBJECT(iterator)) {
1900 throw MakeTypeError(kNotAnIterator, iterator); 1902 throw MakeTypeError(kNotAnIterator, iterator);
1901 } 1903 }
1902 return iterator; 1904 return iterator;
1903 } 1905 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/built-in-accessor-names.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698