| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 | 77 |
| 78 int main(int argc, char* argv[]) { | 78 int main(int argc, char* argv[]) { |
| 79 v8::V8::InitializeICU(); | 79 v8::V8::InitializeICU(); |
| 80 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 80 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
| 81 v8::V8::InitializePlatform(platform); | 81 v8::V8::InitializePlatform(platform); |
| 82 v8::V8::Initialize(); | 82 v8::V8::Initialize(); |
| 83 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 83 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 84 ShellArrayBufferAllocator array_buffer_allocator; | 84 ShellArrayBufferAllocator array_buffer_allocator; |
| 85 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 85 v8::Isolate::CreateParams create_params; |
| 86 v8::Isolate* isolate = v8::Isolate::New(); | 86 create_params.array_buffer_allocator = &array_buffer_allocator; |
| 87 v8::Isolate* isolate = v8::Isolate::New(create_params); |
| 87 run_shell = (argc == 1); | 88 run_shell = (argc == 1); |
| 88 int result; | 89 int result; |
| 89 { | 90 { |
| 90 v8::Isolate::Scope isolate_scope(isolate); | 91 v8::Isolate::Scope isolate_scope(isolate); |
| 91 v8::HandleScope handle_scope(isolate); | 92 v8::HandleScope handle_scope(isolate); |
| 92 v8::Handle<v8::Context> context = CreateShellContext(isolate); | 93 v8::Handle<v8::Context> context = CreateShellContext(isolate); |
| 93 if (context.IsEmpty()) { | 94 if (context.IsEmpty()) { |
| 94 fprintf(stderr, "Error creating context\n"); | 95 fprintf(stderr, "Error creating context\n"); |
| 95 return 1; | 96 return 1; |
| 96 } | 97 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 fprintf(stderr, "^"); | 385 fprintf(stderr, "^"); |
| 385 } | 386 } |
| 386 fprintf(stderr, "\n"); | 387 fprintf(stderr, "\n"); |
| 387 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 388 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 388 if (stack_trace.length() > 0) { | 389 if (stack_trace.length() > 0) { |
| 389 const char* stack_trace_string = ToCString(stack_trace); | 390 const char* stack_trace_string = ToCString(stack_trace); |
| 390 fprintf(stderr, "%s\n", stack_trace_string); | 391 fprintf(stderr, "%s\n", stack_trace_string); |
| 391 } | 392 } |
| 392 } | 393 } |
| 393 } | 394 } |
| OLD | NEW |