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

Unified Diff: tools/detect-builtins.js

Issue 2048593004: [tools] Fix detect-builtins.js (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/detect-builtins.js
diff --git a/tools/detect-builtins.js b/tools/detect-builtins.js
index 2a476baa4b031c4f089553dacb0589417b3db40c..90bdc08860f2e2a81a1ef02bf27543f858fce819 100644
--- a/tools/detect-builtins.js
+++ b/tools/detect-builtins.js
@@ -24,6 +24,8 @@
}
// Avoid endless recursion.
if (this_name === "prototype" && name === "constructor") continue;
+ // Avoid needless duplication.
+ if (this_name === "__PROTO__" && name === "constructor") continue;
// Could get this from the parent, but having it locally is easier.
var property = { "name": name };
try {
@@ -39,9 +41,18 @@
property.length = value.length;
property.prototype = GetProperties("prototype", value.prototype);
}
- property.properties = GetProperties(name, value);
+ if (type === "string" || type === "number") {
+ property.value = value;
+ } else {
+ property.properties = GetProperties(name, value);
+ }
result[name] = property;
}
+ // Print the __proto__ if it's not the default Object prototype.
+ if (typeof object === "object" && object.__proto__ !== null &&
+ !object.__proto__.hasOwnProperty("__proto__")) {
+ result.__PROTO__ = GetProperties("__PROTO__", object.__proto__);
+ }
return result;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698