diff options
Diffstat (limited to 'chromium/v8/src/d8-readline.cc')
-rw-r--r-- | chromium/v8/src/d8-readline.cc | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/chromium/v8/src/d8-readline.cc b/chromium/v8/src/d8-readline.cc index 15b13617279..39c93d35de5 100644 --- a/chromium/v8/src/d8-readline.cc +++ b/chromium/v8/src/d8-readline.cc @@ -1,31 +1,8 @@ // Copyright 2012 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include <cstdio> // NOLINT +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <stdio.h> // NOLINT #include <string.h> // NOLINT #include <readline/readline.h> // NOLINT #include <readline/history.h> // NOLINT @@ -33,7 +10,7 @@ // The readline includes leaves RETURN defined which breaks V8 compilation. #undef RETURN -#include "d8.h" +#include "src/d8.h" // There are incompatibilities between different versions and different // implementations of readline. This smooths out one known incompatibility. @@ -105,10 +82,7 @@ bool ReadLineEditor::Close() { Handle<String> ReadLineEditor::Prompt(const char* prompt) { char* result = NULL; - { // Release lock for blocking input. - Unlocker unlock(Isolate::GetCurrent()); - result = readline(prompt); - } + result = readline(prompt); if (result == NULL) return Handle<String>(); AddHistory(result); return String::NewFromUtf8(isolate_, result); @@ -146,7 +120,6 @@ char* ReadLineEditor::CompletionGenerator(const char* text, int state) { static unsigned current_index; static Persistent<Array> current_completions; Isolate* isolate = read_line_editor.isolate_; - Locker lock(isolate); HandleScope scope(isolate); Handle<Array> completions; if (state == 0) { @@ -163,7 +136,7 @@ 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(current_index); + Handle<Integer> index = Integer::New(isolate, current_index); Handle<Value> str_obj = completions->Get(index); current_index++; String::Utf8Value str(str_obj); |