| Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| index 31c1d938deca8f883f86d70c94fe50df1e4631cb..1207c89de1e01ecc11acbb99eb6b712cff922476 100644
|
| --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| @@ -890,6 +890,15 @@ void ScriptLoader::Execute() {
|
| DCHECK(!will_be_parser_executed_);
|
| DCHECK(async_exec_type_ != ScriptRunner::kNone);
|
| DCHECK(pending_script_->IsExternal());
|
| +
|
| + // If revalidation occurs after the script is scheduled for execution,
|
| + // the script may not be ready at this point.
|
| + // Abort execution and reschedule when the script is ready again.
|
| + if (!pending_script_->IsReady()) {
|
| + pending_script_->WatchForLoad(this);
|
| + return;
|
| + }
|
| +
|
| bool error_occurred = false;
|
| Script* script = pending_script_->GetSource(KURL(), error_occurred);
|
| const bool wasCanceled = pending_script_->WasCanceled();
|
|
|