Commit 709010de authored by jochen@chromium.org's avatar jochen@chromium.org

Remove usage of deprecated APIs from d8

Also turn on deprecation warnings

BUG=v8:3023
R=svenpanne@chromium.org, dcarney@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/83333002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18009 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a294defe
......@@ -63,7 +63,8 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
TryCatch try_catch;
// Get the toJSONProtocol function on the event and get the JSON format.
Local<String> to_json_fun_name = String::New("toJSONProtocol");
Local<String> to_json_fun_name =
String::NewFromUtf8(isolate, "toJSONProtocol");
Handle<Object> event_data = event_details.GetEventData();
Local<Function> to_json_fun =
Local<Function>::Cast(event_data->Get(to_json_fun_name));
......@@ -80,7 +81,7 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
Shell::ReportException(isolate, &try_catch);
return;
}
String::Utf8Value str(details->Get(String::New("text")));
String::Utf8Value str(details->Get(String::NewFromUtf8(isolate, "text")));
if (str.length() == 0) {
// Empty string is used to signal not to process this event.
return;
......@@ -88,7 +89,8 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
printf("%s\n", *str);
// Get the debug command processor.
Local<String> fun_name = String::New("debugCommandProcessor");
Local<String> fun_name =
String::NewFromUtf8(isolate, "debugCommandProcessor");
Handle<Object> exec_state = event_details.GetExecutionState();
Local<Function> fun = Local<Function>::Cast(exec_state->Get(fun_name));
Local<Object> cmd_processor =
......@@ -112,8 +114,8 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
TryCatch try_catch;
// Convert the debugger command to a JSON debugger request.
Handle<Value> request =
Shell::DebugCommandToJSONRequest(isolate, String::New(command));
Handle<Value> request = Shell::DebugCommandToJSONRequest(
isolate, String::NewFromUtf8(isolate, command));
if (try_catch.HasCaught()) {
Shell::ReportException(isolate, &try_catch);
continue;
......@@ -134,7 +136,7 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
// Invoke the JavaScript to convert the debug command line to a JSON
// request, invoke the JSON request and convert the JSON respose to a text
// representation.
fun_name = String::New("processDebugRequest");
fun_name = String::NewFromUtf8(isolate, "processDebugRequest");
fun = Handle<Function>::Cast(cmd_processor->Get(fun_name));
args[0] = request;
Handle<Value> response_val = fun->Call(cmd_processor, kArgc, args);
......@@ -151,12 +153,14 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
Shell::ReportException(isolate, &try_catch);
continue;
}
String::Utf8Value text_str(response_details->Get(String::New("text")));
String::Utf8Value text_str(
response_details->Get(String::NewFromUtf8(isolate, "text")));
if (text_str.length() > 0) {
printf("%s\n", *text_str);
}
running =
response_details->Get(String::New("running"))->ToBoolean()->Value();
running = response_details->Get(String::NewFromUtf8(isolate, "running"))
->ToBoolean()
->Value();
}
}
......@@ -273,15 +277,14 @@ void RemoteDebugger::HandleMessageReceived(char* message) {
// Print the event details.
TryCatch try_catch;
Handle<Object> details =
Shell::DebugMessageDetails(isolate_,
Handle<String>::Cast(String::New(message)));
Handle<Object> details = Shell::DebugMessageDetails(
isolate_, Handle<String>::Cast(String::NewFromUtf8(isolate_, message)));
if (try_catch.HasCaught()) {
Shell::ReportException(isolate_, &try_catch);
PrintPrompt();
return;
}
String::Utf8Value str(details->Get(String::New("text")));
String::Utf8Value str(details->Get(String::NewFromUtf8(isolate_, "text")));
if (str.length() == 0) {
// Empty string is used to signal not to process this event.
return;
......@@ -292,7 +295,9 @@ void RemoteDebugger::HandleMessageReceived(char* message) {
printf("???\n");
}
bool is_running = details->Get(String::New("running"))->ToBoolean()->Value();
bool is_running = details->Get(String::NewFromUtf8(isolate_, "running"))
->ToBoolean()
->Value();
PrintPrompt(is_running);
}
......@@ -303,8 +308,8 @@ void RemoteDebugger::HandleKeyboardCommand(char* command) {
// Convert the debugger command to a JSON debugger request.
TryCatch try_catch;
Handle<Value> request =
Shell::DebugCommandToJSONRequest(isolate_, String::New(command));
Handle<Value> request = Shell::DebugCommandToJSONRequest(
isolate_, String::NewFromUtf8(isolate_, command));
if (try_catch.HasCaught()) {
Shell::ReportException(isolate_, &try_catch);
PrintPrompt();
......
This diff is collapsed.
......@@ -35,7 +35,7 @@
namespace v8 {
void Shell::AddOSMethods(Handle<ObjectTemplate> os_templ) {
void Shell::AddOSMethods(Isolate* isolate, Handle<ObjectTemplate> os_templ) {
}
......
This diff is collapsed.
......@@ -33,12 +33,6 @@
'v8_enable_vtunejit%': 0,
'v8_enable_i18n_support%': 1,
},
'target_defaults': {
'variables': {
# TODO(jochen): enable warnings.
'v8_deprecation_warnings': 0,
},
},
'includes': ['../build/toolchain.gypi', '../build/features.gypi'],
'targets': [
{
......
......@@ -377,7 +377,8 @@ class Shell : public i::AllStatic {
static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
static void AddOSMethods(Handle<ObjectTemplate> os_template);
static void AddOSMethods(v8::Isolate* isolate,
Handle<ObjectTemplate> os_template);
static const char* kPrompt;
static ShellOptions options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment