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; |
}; |