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

Unified Diff: src/d8-readline.cc

Issue 1239053004: Make d8 stop using to-be-deprecated APIs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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 39c93d35de5859f49b3a697b09cec2a2be7108e3..eca6553af86506162f3c0239ac6539d576e3e3f8 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -25,7 +25,7 @@ namespace v8 {
class ReadLineEditor: public LineEditor {
public:
ReadLineEditor() : LineEditor(LineEditor::READLINE, "readline") { }
- virtual Handle<String> Prompt(const char* prompt);
+ virtual Local<String> Prompt(const char* prompt);
virtual bool Open(Isolate* isolate);
virtual bool Close();
virtual void AddHistory(const char* str);
@@ -80,10 +80,10 @@ bool ReadLineEditor::Close() {
}
-Handle<String> ReadLineEditor::Prompt(const char* prompt) {
+Local<String> ReadLineEditor::Prompt(const char* prompt) {
char* result = NULL;
result = readline(prompt);
- if (result == NULL) return Handle<String>();
+ if (result == NULL) return Local<String>();
AddHistory(result);
return String::NewFromUtf8(isolate_, result);
}
@@ -118,10 +118,10 @@ char** ReadLineEditor::AttemptedCompletion(const char* text,
char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
static unsigned current_index;
- static Persistent<Array> current_completions;
+ static Global<Array> current_completions;
Isolate* isolate = read_line_editor.isolate_;
HandleScope scope(isolate);
- Handle<Array> completions;
+ Local<Array> completions;
if (state == 0) {
Local<String> full_text = String::NewFromUtf8(isolate,
rl_line_buffer,
@@ -136,8 +136,8 @@ char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
completions = Local<Array>::New(isolate, current_completions);
}
if (current_index < completions->Length()) {
- Handle<Integer> index = Integer::New(isolate, current_index);
- Handle<Value> str_obj = completions->Get(index);
+ Local<Integer> index = Integer::New(isolate, current_index);
+ Local<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