I was building d8 from the master of
github.com/v8/v8 today, but there were some warnings in d8-readline.cc that got treated as errors, so the build failed.
$ git diff
diff --git a/src/d8-readline.cc b/src/d8-readline.cc
index 0226f31..b920362 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -114,7 +114,7 @@ Handle<String> ReadLineEditor::Prompt(const char* prompt) {
} else {
return Handle<String>();
}
- return String::New(result);
+ return String::NewFromUtf8(Isolate::GetCurrent(), result);
}
@@ -153,8 +153,8 @@ 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 {