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

Unified Diff: src/js/prologue.js

Issue 1416093006: Unify setting accessor properties in native code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/messages.js ('k') | src/js/regexp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/prologue.js
diff --git a/src/js/prologue.js b/src/js/prologue.js
index 2e3643e09d1731d6f333095ed7b2a110baf5fcff..0f605be6490839ccaa7e35ddad327e435318e69f 100644
--- a/src/js/prologue.js
+++ b/src/js/prologue.js
@@ -102,21 +102,20 @@ function InstallFunctions(object, attributes, functions) {
// Helper function to install a getter-only accessor property.
-function InstallGetter(object, name, getter, attributes) {
+function InstallGetter(object, name, getter, attributes, prefix) {
%CheckIsBootstrapping();
- if (typeof attributes == "undefined") {
- attributes = DONT_ENUM;
- }
- SetFunctionName(getter, name, "get");
+ if (IS_UNDEFINED(attributes)) attributes = DONT_ENUM;
+ SetFunctionName(getter, name, IS_UNDEFINED(prefix) ? "get" : prefix);
%FunctionRemovePrototype(getter);
- %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes);
+ %DefineGetterPropertyUnchecked(object, name, getter, attributes);
%SetNativeFlag(getter);
}
// Helper function to install a getter/setter accessor property.
-function InstallGetterSetter(object, name, getter, setter) {
+function InstallGetterSetter(object, name, getter, setter, attributes) {
%CheckIsBootstrapping();
+ if (IS_UNDEFINED(attributes)) attributes = DONT_ENUM;
SetFunctionName(getter, name, "get");
SetFunctionName(setter, name, "set");
%FunctionRemovePrototype(getter);
« no previous file with comments | « src/js/messages.js ('k') | src/js/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698