Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: src/d8.cc

Issue 2611643002: [modules] Add an IsModule flag to ScriptOriginOptions. (Closed)
Patch Set: Remove convenience function from API. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698