Index: src/d8.js |
diff --git a/src/d8.js b/src/d8.js |
index 65646f7bf2f0b03050368ab762665f73c47b2adb..8d55c788e2b42fa0d591ed146316c2c29dd9f365 100644 |
--- a/src/d8.js |
+++ b/src/d8.js |
@@ -4,51 +4,6 @@ |
"use strict"; |
-String.prototype.startsWith = function (str) { |
- if (str.length > this.length) { |
- return false; |
- } |
- return this.substr(0, str.length) == str; |
-}; |
- |
-function ToInspectableObject(obj) { |
- if (!obj && typeof obj === 'object') { |
- return UNDEFINED; |
- } else { |
- return Object(obj); |
- } |
-} |
- |
-function GetCompletions(global, last, full) { |
- var full_tokens = full.split(); |
- full = full_tokens.pop(); |
- var parts = full.split('.'); |
- parts.pop(); |
- var current = global; |
- for (var i = 0; i < parts.length; i++) { |
- var part = parts[i]; |
- var next = current[part]; |
- if (!next) { |
- return []; |
- } |
- current = next; |
- } |
- var result = []; |
- current = ToInspectableObject(current); |
- while (typeof current !== 'undefined') { |
- var mirror = new $debug.ObjectMirror(current); |
- var properties = mirror.properties(); |
- for (var i = 0; i < properties.length; i++) { |
- var name = properties[i].name(); |
- if (typeof name === 'string' && name.startsWith(last)) { |
- result.push(name); |
- } |
- } |
- current = ToInspectableObject(Object.getPrototypeOf(current)); |
- } |
- return result; |
-} |
- |
// A more universal stringify that supports more types than JSON. |
// Used by the d8 shell to output results. |
var stringifyDepthLimit = 4; // To avoid crashing on cyclic objects |