| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 (function(global, utils, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
| 6 | 6 |
| 7 "use strict"; | 7 "use strict"; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 SetFunctionName(f, key); | 95 SetFunctionName(f, key); |
| 96 %FunctionRemovePrototype(f); | 96 %FunctionRemovePrototype(f); |
| 97 %AddNamedProperty(object, key, f, attributes); | 97 %AddNamedProperty(object, key, f, attributes); |
| 98 %SetNativeFlag(f); | 98 %SetNativeFlag(f); |
| 99 } | 99 } |
| 100 %ToFastProperties(object); | 100 %ToFastProperties(object); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 // Helper function to install a getter-only accessor property. | 104 // Helper function to install a getter-only accessor property. |
| 105 function InstallGetter(object, name, getter, attributes, prefix) { | 105 function InstallGetter(object, name, getter, attributes, skipSetFunctionName) { |
| 106 %CheckIsBootstrapping(); | 106 %CheckIsBootstrapping(); |
| 107 if (IS_UNDEFINED(attributes)) attributes = DONT_ENUM; | 107 if (IS_UNDEFINED(attributes)) attributes = DONT_ENUM; |
| 108 SetFunctionName(getter, name, IS_UNDEFINED(prefix) ? "get" : prefix); | 108 if (IS_UNDEFINED(skipSetFunctionName)) { |
| 109 SetFunctionName(getter, name, "get"); |
| 110 } |
| 109 %FunctionRemovePrototype(getter); | 111 %FunctionRemovePrototype(getter); |
| 110 %DefineGetterPropertyUnchecked(object, name, getter, attributes); | 112 %DefineGetterPropertyUnchecked(object, name, getter, attributes); |
| 111 %SetNativeFlag(getter); | 113 %SetNativeFlag(getter); |
| 112 } | 114 } |
| 113 | 115 |
| 114 | 116 |
| 115 // Helper function to install a getter/setter accessor property. | 117 // Helper function to install a getter/setter accessor property. |
| 116 function InstallGetterSetter(object, name, getter, setter, attributes) { | 118 function InstallGetterSetter(object, name, getter, setter, attributes) { |
| 117 %CheckIsBootstrapping(); | 119 %CheckIsBootstrapping(); |
| 118 if (IS_UNDEFINED(attributes)) attributes = DONT_ENUM; | 120 if (IS_UNDEFINED(attributes)) attributes = DONT_ENUM; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 360 |
| 359 extrasUtils.uncurryThis = function uncurryThis(func) { | 361 extrasUtils.uncurryThis = function uncurryThis(func) { |
| 360 return function(thisArg, ...args) { | 362 return function(thisArg, ...args) { |
| 361 return %reflect_apply(func, thisArg, args); | 363 return %reflect_apply(func, thisArg, args); |
| 362 }; | 364 }; |
| 363 }; | 365 }; |
| 364 | 366 |
| 365 %ToFastProperties(extrasUtils); | 367 %ToFastProperties(extrasUtils); |
| 366 | 368 |
| 367 }) | 369 }) |
| OLD | NEW |