Chromium Code Reviews| Index: src/d8.cc |
| diff --git a/src/d8.cc b/src/d8.cc |
| index 9466ab7d3a727c2fe12d70ac977df0b0cac57f35..46b52baa5c70b1f1cc2c9211cdf9d69538cb40b5 100644 |
| --- a/src/d8.cc |
| +++ b/src/d8.cc |
| @@ -338,7 +338,9 @@ MaybeLocal<Script> Shell::CompileString( |
| ScriptCompiler::CompileOptions compile_options, SourceType source_type) { |
| Local<Context> context(isolate->GetCurrentContext()); |
| ScriptOrigin origin(name); |
| - if (compile_options == ScriptCompiler::kNoCompileOptions) { |
| + // TODO(adamk): Make use of compile options for Modules. |
| + if (compile_options == ScriptCompiler::kNoCompileOptions || |
| + source_type == MODULE) { |
| ScriptCompiler::Source script_source(source, origin); |
| return source_type == SCRIPT |
| ? ScriptCompiler::Compile(context, &script_source, |
| @@ -359,10 +361,7 @@ MaybeLocal<Script> Shell::CompileString( |
| } |
| if (data == NULL) compile_options = ScriptCompiler::kNoCompileOptions; |
| MaybeLocal<Script> result = |
| - source_type == SCRIPT |
|
Dan Ehrenberg
2016/05/27 09:51:18
Add a check here that source_type == SCRIPT?
adamk
2016/05/27 18:53:07
Done.
|
| - ? ScriptCompiler::Compile(context, &cached_source, compile_options) |
| - : ScriptCompiler::CompileModule(context, &cached_source, |
| - compile_options); |
| + ScriptCompiler::Compile(context, &cached_source, compile_options); |
| CHECK(data == NULL || !data->rejected); |
| return result; |
| } |