Chromium Code Reviews| Index: src/v8natives.js |
| diff --git a/src/v8natives.js b/src/v8natives.js |
| index 41453d0b5364660c24f8cd9a51c93a9e71de6ffd..65b0334c523c6f47f9d485a8ecaa3bb6cbbf0160 100644 |
| --- a/src/v8natives.js |
| +++ b/src/v8natives.js |
| @@ -46,7 +46,8 @@ function InstallGetter(object, name, getter, attributes) { |
| if (typeof attributes == "undefined") { |
| attributes = DONT_ENUM; |
| } |
| - %FunctionSetName(getter, name); |
| + %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.
|
| + IS_SYMBOL(name) ? `[${%SymbolDescription(name)}]` : name}`); |
| %FunctionRemovePrototype(getter); |
| %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes); |
| %SetNativeFlag(getter); |
| @@ -55,8 +56,9 @@ function InstallGetter(object, name, getter, attributes) { |
| // Helper function to install a getter/setter accessor property. |
| function InstallGetterSetter(object, name, getter, setter) { |
| - %FunctionSetName(getter, name); |
| - %FunctionSetName(setter, name); |
| + var functionName = IS_SYMBOL(name) ? `[${%SymbolDescription(name)}]` : name; |
| + %FunctionSetName(getter, `get ${functionName}`); |
| + %FunctionSetName(setter, `set ${functionName}`); |
| %FunctionRemovePrototype(getter); |
| %FunctionRemovePrototype(setter); |
| %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM); |