提交 c198c321 编写于 作者: A Adam Barth

Don't crash when importing a 404

Now we have a test for this case.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/682913002
上级 de93d90c
......@@ -353,7 +353,10 @@ void ScriptController::executeModuleScript(Document& document, const String& sou
String name = link->as();
if (!name.isEmpty()) {
module.formalDependenciesAndSource.append(v8String(m_isolate, name));
module.resolvedDependencies.append(child->document() ? child->document()->exports().v8Value() : v8Undefined());
v8::Handle<v8::Value> actual = v8::Undefined(m_isolate);
if (child->document())
actual = child->document()->exports().v8Value();
module.resolvedDependencies.append(actual);
}
}
}
......
......@@ -121,8 +121,10 @@ void HTMLImportLoader::setState(State state)
m_state = state;
if (m_state == StateParsed || m_state == StateError || m_state == StateWritten)
m_document->cancelParsing();
if (m_state == StateParsed || m_state == StateError || m_state == StateWritten) {
if (m_document)
m_document->cancelParsing();
}
// Since DocumentWriter::end() can let setState() reenter, we shouldn't refer to m_state here.
if (state == StateLoaded || state == StateError)
......
<html>
<link rel="import" href="resources/does-not-exist.html" as="hello" />
<link rel="import" href="../resources/dump-as-text.html" />
<div id="result">FAIL - Script did not execute</div>
<script>
document.getElementById("result").textContent =
hello === undefined ? "PASS" : "FAIL";
</script>
</html>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册