| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void Quit(const v8::FunctionCallbackInfo<v8::Value>& args); | 59 void Quit(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 60 void Version(const v8::FunctionCallbackInfo<v8::Value>& args); | 60 void Version(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 61 v8::Handle<v8::String> ReadFile(const char* name); | 61 v8::Handle<v8::String> ReadFile(const char* name); |
| 62 void ReportException(v8::Isolate* isolate, v8::TryCatch* handler); | 62 void ReportException(v8::Isolate* isolate, v8::TryCatch* handler); |
| 63 | 63 |
| 64 | 64 |
| 65 static bool run_shell; | 65 static bool run_shell; |
| 66 | 66 |
| 67 | 67 |
| 68 int main(int argc, char* argv[]) { | 68 int main(int argc, char* argv[]) { |
| 69 v8::V8::InitializeICU(); |
| 69 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 70 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 70 v8::V8::SetFlagsFromString("--noenable_i18n", | |
| 71 static_cast<int>(strlen("--noenable_i18n"))); | |
| 72 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 71 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 73 run_shell = (argc == 1); | 72 run_shell = (argc == 1); |
| 74 int result; | 73 int result; |
| 75 { | 74 { |
| 76 v8::HandleScope handle_scope(isolate); | 75 v8::HandleScope handle_scope(isolate); |
| 77 v8::Handle<v8::Context> context = CreateShellContext(isolate); | 76 v8::Handle<v8::Context> context = CreateShellContext(isolate); |
| 78 if (context.IsEmpty()) { | 77 if (context.IsEmpty()) { |
| 79 fprintf(stderr, "Error creating context\n"); | 78 fprintf(stderr, "Error creating context\n"); |
| 80 return 1; | 79 return 1; |
| 81 } | 80 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 fprintf(stderr, "^"); | 346 fprintf(stderr, "^"); |
| 348 } | 347 } |
| 349 fprintf(stderr, "\n"); | 348 fprintf(stderr, "\n"); |
| 350 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 349 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 351 if (stack_trace.length() > 0) { | 350 if (stack_trace.length() > 0) { |
| 352 const char* stack_trace_string = ToCString(stack_trace); | 351 const char* stack_trace_string = ToCString(stack_trace); |
| 353 fprintf(stderr, "%s\n", stack_trace_string); | 352 fprintf(stderr, "%s\n", stack_trace_string); |
| 354 } | 353 } |
| 355 } | 354 } |
| 356 } | 355 } |
| OLD | NEW |