Unlocker unlock(Isolate::GetCurrent());
result = readline(prompt);
}
- if (result != NULL) {
- AddHistory(result);
- } else {
- return Handle<String>();
- }
- return String::New(result);
+ if (result == NULL) return Handle<String>();
+ AddHistory(result);
+ return String::NewFromUtf8(isolate_, result);
}
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 {