[modules] Fix mapping of internal status to external status.

Internally, the module status type has one additional value, namely
PreInstantiating. I previously mapped this to Instantiating when
crossing the API boundary but it really should be mapped to
Uninstantiated. That's because when instantiation fails, typically all
modules not yet visited will remain in the PreInstantiating state, yet
they must appear Uninstantiated to the outside.

A relevant test will be added to chromium shortly.

Bug: v8:1569, chromium:748544
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Icb33c7f90db5e62375b6c09d14e3d2d5342b0879
Reviewed-on: https://chromium-review.googlesource.com/586602
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46911}
This commit is contained in:
Georg Neis 2017-07-26 15:39:58 +02:00 committed by Commit Bot
parent 61ed6a0088
commit e017463189

View File

@ -2098,8 +2098,8 @@ Module::Status Module::GetStatus() const {
i::Handle<i::Module> self = Utils::OpenHandle(this);
switch (self->status()) {
case i::Module::kUninstantiated:
return kUninstantiated;
case i::Module::kPreInstantiating:
return kUninstantiated;
case i::Module::kInstantiating:
return kInstantiating;
case i::Module::kInstantiated: