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

Unified Diff: Source/WebCore/bindings/js/WorkerScriptController.cpp

Issue 6519013: Merge 77563 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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/WebCore/bindings/js/WorkerScriptController.cpp
===================================================================
--- Source/WebCore/bindings/js/WorkerScriptController.cpp (revision 78484)
+++ Source/WebCore/bindings/js/WorkerScriptController.cpp (working copy)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2011 Google Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -131,8 +132,15 @@
if (comp.complType() == Normal || comp.complType() == ReturnValue)
return comp.value();
- if (comp.complType() == Throw)
- *exception = comp.value();
+ if (comp.complType() == Throw) {
+ String errorMessage;
+ int lineNumber = 0;
+ String sourceURL = sourceCode.url().string();
+ if (m_workerContext->sanitizeScriptError(errorMessage, lineNumber, sourceURL))
+ *exception = ScriptValue(throwError(exec, createError(exec, errorMessage.impl())));
+ else
+ *exception = comp.value();
+ }
return JSValue();
}

Powered by Google App Engine
This is Rietveld 408576698