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

Unified Diff: src/d8-readline.cc

Issue 85343002: Unbreak console=readline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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: src/d8-readline.cc
diff --git a/src/d8-readline.cc b/src/d8-readline.cc
index 0226f31c0ba14d1f501a16f0d9dc27c6d73c7121..15b1361727960fbbfedf3d8bf7fcbdbf726d3f57 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -109,12 +109,9 @@ Handle<String> ReadLineEditor::Prompt(const char* prompt) {
Unlocker unlock(Isolate::GetCurrent());
result = readline(prompt);
}
- if (result != NULL) {
- AddHistory(result);
- } else {
- return Handle<String>();
- }
- return String::New(result);
+ if (result == NULL) return Handle<String>();
+ AddHistory(result);
+ return String::NewFromUtf8(isolate_, result);
}
@@ -153,8 +150,13 @@ char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
HandleScope scope(isolate);
Handle<Array> completions;
if (state == 0) {
- Local<String> full_text = String::New(rl_line_buffer, rl_point);
- completions = Shell::GetCompletions(isolate, String::New(text), full_text);
+ Local<String> full_text = String::NewFromUtf8(isolate,
+ rl_line_buffer,
+ String::kNormalString,
+ rl_point);
+ completions = Shell::GetCompletions(isolate,
+ String::NewFromUtf8(isolate, text),
+ full_text);
current_completions.Reset(isolate, completions);
current_index = 0;
} else {
« 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