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

Unified Diff: src/d8-readline.cc

Issue 1240993003: Revert of Make d8 stop using to-be-deprecated APIs (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-posix.cc ('k') | src/d8-windows.cc » ('j') | 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..39c93d35de5859f49b3a697b09cec2a2be7108e3 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -25,7 +25,7 @@
class ReadLineEditor: public LineEditor {
public:
ReadLineEditor() : LineEditor(LineEditor::READLINE, "readline") { }
- virtual Local<String> Prompt(const char* prompt);
+ virtual Handle<String> Prompt(const char* prompt);
virtual bool Open(Isolate* isolate);
virtual bool Close();
virtual void AddHistory(const char* str);
@@ -80,10 +80,10 @@
}
-Local<String> ReadLineEditor::Prompt(const char* prompt) {
+Handle<String> ReadLineEditor::Prompt(const char* prompt) {
char* result = NULL;
result = readline(prompt);
- if (result == NULL) return Local<String>();
+ if (result == NULL) return Handle<String>();
AddHistory(result);
return String::NewFromUtf8(isolate_, result);
}
@@ -118,10 +118,10 @@
char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
static unsigned current_index;
- static Global<Array> current_completions;
+ static Persistent<Array> current_completions;
Isolate* isolate = read_line_editor.isolate_;
HandleScope scope(isolate);
- Local<Array> completions;
+ Handle<Array> completions;
if (state == 0) {
Local<String> full_text = String::NewFromUtf8(isolate,
rl_line_buffer,
@@ -136,8 +136,8 @@
completions = Local<Array>::New(isolate, current_completions);
}
if (current_index < completions->Length()) {
- Local<Integer> index = Integer::New(isolate, current_index);
- Local<Value> str_obj = completions->Get(index);
+ Handle<Integer> index = Integer::New(isolate, current_index);
+ Handle<Value> str_obj = completions->Get(index);
current_index++;
String::Utf8Value str(str_obj);
return strdup(*str);
« no previous file with comments | « src/d8-posix.cc ('k') | src/d8-windows.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698