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

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: Make sure the function name is flattened 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 | « src/runtime/runtime-function.cc ('k') | 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 " +
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 =
59 %FunctionSetName(setter, name); 60 IS_SYMBOL(name) ? "[" + %SymbolDescription(name) + "]" : name;
61 %FunctionSetName(getter, "get " + functionName);
62 %FunctionSetName(setter, "set " + functionName);
60 %FunctionRemovePrototype(getter); 63 %FunctionRemovePrototype(getter);
61 %FunctionRemovePrototype(setter); 64 %FunctionRemovePrototype(setter);
62 %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM); 65 %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM);
63 %SetNativeFlag(getter); 66 %SetNativeFlag(getter);
64 %SetNativeFlag(setter); 67 %SetNativeFlag(setter);
65 } 68 }
66 69
67 70
68 // Helper function for installing constant properties on objects. 71 // Helper function for installing constant properties on objects.
69 function InstallConstants(object, constants) { 72 function InstallConstants(object, constants) {
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1897 }
1895 if (!IS_SPEC_FUNCTION(method)) { 1898 if (!IS_SPEC_FUNCTION(method)) {
1896 throw MakeTypeError(kNotIterable, obj); 1899 throw MakeTypeError(kNotIterable, obj);
1897 } 1900 }
1898 var iterator = %_CallFunction(obj, method); 1901 var iterator = %_CallFunction(obj, method);
1899 if (!IS_SPEC_OBJECT(iterator)) { 1902 if (!IS_SPEC_OBJECT(iterator)) {
1900 throw MakeTypeError(kNotAnIterator, iterator); 1903 throw MakeTypeError(kNotAnIterator, iterator);
1901 } 1904 }
1902 return iterator; 1905 return iterator;
1903 } 1906 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | test/mjsunit/es6/built-in-accessor-names.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698