OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 Isolate* isolate = context->GetIsolate(); | 687 Isolate* isolate = context->GetIsolate(); |
688 TryCatch try_catch(isolate); | 688 TryCatch try_catch(isolate); |
689 try_catch.SetVerbose(true); | 689 try_catch.SetVerbose(true); |
690 Local<String> source_text = ReadFile(isolate, file_name.c_str()); | 690 Local<String> source_text = ReadFile(isolate, file_name.c_str()); |
691 if (source_text.IsEmpty()) { | 691 if (source_text.IsEmpty()) { |
692 printf("Error reading '%s'\n", file_name.c_str()); | 692 printf("Error reading '%s'\n", file_name.c_str()); |
693 Shell::Exit(1); | 693 Shell::Exit(1); |
694 } | 694 } |
695 ScriptOrigin origin( | 695 ScriptOrigin origin( |
696 String::NewFromUtf8(isolate, file_name.c_str(), NewStringType::kNormal) | 696 String::NewFromUtf8(isolate, file_name.c_str(), NewStringType::kNormal) |
697 .ToLocalChecked()); | 697 .ToLocalChecked(), |
| 698 Local<Integer>(), Local<Integer>(), Local<Boolean>(), Local<Integer>(), |
| 699 Local<Value>(), Local<Boolean>(), Local<Boolean>(), True(isolate)); |
698 ScriptCompiler::Source source(source_text, origin); | 700 ScriptCompiler::Source source(source_text, origin); |
699 Local<Module> module; | 701 Local<Module> module; |
700 if (!ScriptCompiler::CompileModule(isolate, &source).ToLocal(&module)) { | 702 if (!ScriptCompiler::CompileModule(isolate, &source).ToLocal(&module)) { |
701 ReportException(isolate, &try_catch); | 703 ReportException(isolate, &try_catch); |
702 return MaybeLocal<Module>(); | 704 return MaybeLocal<Module>(); |
703 } | 705 } |
704 | 706 |
705 ModuleEmbedderData* d = GetModuleDataFromContext(context); | 707 ModuleEmbedderData* d = GetModuleDataFromContext(context); |
706 CHECK(d->specifier_to_module_map | 708 CHECK(d->specifier_to_module_map |
707 .insert(std::make_pair(file_name, Global<Module>(isolate, module))) | 709 .insert(std::make_pair(file_name, Global<Module>(isolate, module))) |
(...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3081 } | 3083 } |
3082 | 3084 |
3083 } // namespace v8 | 3085 } // namespace v8 |
3084 | 3086 |
3085 | 3087 |
3086 #ifndef GOOGLE3 | 3088 #ifndef GOOGLE3 |
3087 int main(int argc, char* argv[]) { | 3089 int main(int argc, char* argv[]) { |
3088 return v8::Shell::Main(argc, argv); | 3090 return v8::Shell::Main(argc, argv); |
3089 } | 3091 } |
3090 #endif | 3092 #endif |
OLD | NEW |