Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1170)

Unified Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 22467005: Correctly attribute exceptions thrown inside a Worker's imported scripts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index 263c9ec6874424fbc91bc06f25e66f22c844e91a..f80e1ffce1fbce92a2df89978d9e09dd0faf7832 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -214,10 +214,10 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
InspectorInstrumentation::scriptImported(scriptExecutionContext(), scriptLoader->identifier(), scriptLoader->script());
- ScriptValue exception;
- m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &exception);
- if (!exception.hasNoValue()) {
- m_script->setException(exception);
+ RefPtr<ErrorEvent> errorEvent;
+ m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &errorEvent);
+ if (errorEvent) {
+ m_script->rethrowExceptionFromImportedScript(errorEvent.release());
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698