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

Unified Diff: src/d8-readline.cc

Issue 11776017: Enable readline on d8 while building a shared lib. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8-readline.cc
diff --git a/src/d8-readline.cc b/src/d8-readline.cc
index ed7721c5131bd818bf70db18b1b9f065f21fcb0e..89892631f76ca0a9811c83038dbfed39d6789f3a 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
#include <cstdio> // NOLINT
+#include <string.h> // NOLINT
#include <readline/readline.h> // NOLINT
#include <readline/history.h> // NOLINT
@@ -35,7 +35,6 @@
#include "d8.h"
-
// There are incompatibilities between different versions and different
// implementations of readline. This smooths out one known incompatibility.
#if RL_READLINE_VERSION >= 0x0500
@@ -58,8 +57,10 @@ class ReadLineEditor: public LineEditor {
static const int kMaxHistoryEntries;
private:
+#ifndef V8_SHARED
static char** AttemptedCompletion(const char* text, int start, int end);
static char* CompletionGenerator(const char* text, int state);
+#endif // V8_SHARED
static char kWordBreakCharacters[];
};
@@ -76,7 +77,15 @@ const int ReadLineEditor::kMaxHistoryEntries = 1000;
bool ReadLineEditor::Open() {
rl_initialize();
+
+#ifdef V8_SHARED
+ // Don't do completion on shared library mode
+ // http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC24
+ rl_bind_key('\t', rl_insert);
+#else
rl_attempted_completion_function = AttemptedCompletion;
+#endif // V8_SHARED
+
rl_completer_word_break_characters = kWordBreakCharacters;
rl_bind_key('\t', rl_complete);
using_history();
@@ -122,6 +131,7 @@ void ReadLineEditor::AddHistory(const char* str) {
}
+#ifndef V8_SHARED
char** ReadLineEditor::AttemptedCompletion(const char* text,
int start,
int end) {
@@ -155,6 +165,7 @@ char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
return NULL;
}
}
+#endif // V8_SHARED
} // namespace v8
« no previous file with comments | « src/d8.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698