[modules] Make Evaluate deal with errored dependencies.

Apparently it can happen that Blink calls Evaluate on a module that has
errored dependencies.

R=adamk@chromium.org

Bug: v8:1569, chromium:750024
Change-Id: I44b6dde2d5fe5ca25ca2b8c44ede2683d1be944d
Reviewed-on: https://chromium-review.googlesource.com/596055
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47071}
This commit is contained in:
Georg Neis 2017-08-01 19:20:13 +02:00 committed by Commit Bot
parent 3fe1421858
commit 31173f92e5

View File

@ -20131,7 +20131,10 @@ MaybeHandle<Object> Module::Evaluate(Handle<Module> module,
ZoneForwardList<Handle<Module>>* stack,
unsigned* dfs_index) {
Isolate* isolate = module->GetIsolate();
DCHECK_NE(module->status(), kErrored);
if (module->status() == kErrored) {
isolate->Throw(module->GetException());
return MaybeHandle<Object>();
}
if (module->status() >= kEvaluating) {
return isolate->factory()->undefined_value();
}