Skip to content

Commit

Permalink
[ES6 modules] ModuleMap::GetFetchedModuleScript to return nullptr whe…
Browse files Browse the repository at this point in the history
…n entry not found / "fetching"

Before this CL, we asserted that ModuleMap::GetFetchedModuleScript always queried load completed module scripts, but it was not always the case.
This CL changes the member function to return nullptr if the entry doesn't exist or the entry is being fetched.

This CL fixes a crash that happens when we early-exit module script graph fetch by a sub-graph instantiation failed, but there are still partial subgraph in flight.

BUG=718442,594639

Review-Url: https://codereview.chromium.org/2860993002
Cr-Commit-Position: refs/heads/master@{#472192}
  • Loading branch information
nyaxt authored and chromium-wpt-export-bot committed May 16, 2017
1 parent 2d89048 commit 9cc4d78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="module">
import { delayedLoaded } from "./resources/delayed-modulescript.py";
import { A } from "./404.js";
window.loadSuccess = delayedLoaded;
</script>
<script type="module">
test(function () {
assert_equals(window.loadSuccess, undefined,
"module tree w/ its sub graph 404 should fail to load without crashing");
}, "Import a module graph w/ sub-graph 404.");
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import time

def main(request, response):
delay = float(request.GET.first("ms", 500))
time.sleep(delay / 1E3);

return [("Content-type", "text/javascript")], "export let delayedLoaded = true;"

0 comments on commit 9cc4d78

Please sign in to comment.