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

Unified Diff: src/d8.js

Issue 1250223002: Remove readline support from d8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « src/d8.gyp ('k') | src/d8-readline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/d8.gyp ('k') | src/d8-readline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698