Index: Source/core/html/parser/HTMLScriptRunner.cpp |
diff --git a/Source/core/html/parser/HTMLScriptRunner.cpp b/Source/core/html/parser/HTMLScriptRunner.cpp |
index 2db20e2aebadc2c46285bf4a52699e25d1a8e36a..304fe38a66363dce7be77f57450579557291cec7 100644 |
--- a/Source/core/html/parser/HTMLScriptRunner.cpp |
+++ b/Source/core/html/parser/HTMLScriptRunner.cpp |
@@ -152,8 +152,11 @@ void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendi |
scriptLoader->dispatchErrorEvent(); |
else { |
ASSERT(isExecutingScript()); |
- scriptLoader->executeScript(sourceCode, &compilationFinishTime); |
- element->dispatchEvent(createScriptLoadEvent()); |
+ if (!scriptLoader->executeScript(sourceCode, &compilationFinishTime)) { |
+ scriptLoader->dispatchErrorEvent(); |
+ } else { |
+ element->dispatchEvent(createScriptLoadEvent()); |
+ } |
} |
} |
// The exact value doesn't matter; valid time stamps are much bigger than this value. |