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

Unified Diff: src/d8-readline.cc

Issue 1242973002: [d8] Remove deprecated calls from d8-readline (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 | « 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 eca6553af86506162f3c0239ac6539d576e3e3f8..e57b7567e3b5dd4a36701a8e62dcbad371ed5cc2 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -85,7 +85,8 @@ Local<String> ReadLineEditor::Prompt(const char* prompt) {
result = readline(prompt);
if (result == NULL) return Local<String>();
AddHistory(result);
- return String::NewFromUtf8(isolate_, result);
+ return String::NewFromUtf8(isolate_, result, NewStringType::kNormal)
+ .ToLocalChecked();
}
@@ -123,21 +124,23 @@ char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
HandleScope scope(isolate);
Local<Array> completions;
if (state == 0) {
- Local<String> full_text = String::NewFromUtf8(isolate,
- rl_line_buffer,
- String::kNormalString,
- rl_point);
- completions = Shell::GetCompletions(isolate,
- String::NewFromUtf8(isolate, text),
- full_text);
+ Local<String> full_text =
+ String::NewFromUtf8(isolate, rl_line_buffer, NewStringType::kNormal,
+ rl_point)
+ .ToLocalChecked();
+ completions = Shell::GetCompletions(
+ isolate, String::NewFromUtf8(isolate, text, NewStringType::kNormal)
+ .ToLocalChecked(),
+ full_text);
current_completions.Reset(isolate, completions);
current_index = 0;
} else {
completions = Local<Array>::New(isolate, current_completions);
}
if (current_index < completions->Length()) {
+ Local<Context> context(isolate->GetCurrentContext());
Local<Integer> index = Integer::New(isolate, current_index);
- Local<Value> str_obj = completions->Get(index);
+ Local<Value> str_obj = completions->Get(context, index).ToLocalChecked();
current_index++;
String::Utf8Value str(str_obj);
return strdup(*str);
« 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