Remove usage of deprecated API in d8

6 views
Skip to first unread message

redna...@gmail.com

unread,
Nov 24, 2013, 8:58:29 AM11/24/13
to v8-...@googlegroups.com
Hi all,

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.

Looks like it's a remanent from Issue 12426015: https://chromiumcodereview.appspot.com/12426015

A quick patch to fix the problem:

$ 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 {


Best regards,
Kris

Sven Panne

unread,
Nov 25, 2013, 3:34:14 AM11/25/13
to v8-...@googlegroups.com
Fixed by a slight variation of your patch. Hmmm, I thought we had a build bot covering the console=readline configuration...

Thanks for the patch,
    S.

Krystal Mok

unread,
Nov 25, 2013, 10:35:28 AM11/25/13
to v8-...@googlegroups.com
Hi Sven,

Alrighty, thanks for fixing it!

- Kris


--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to a topic in the Google Groups "v8-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-dev/hFeGaRLnca8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages