REGRESSION(r59977): platform/mac/fast/AppleScript/001.html failure
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 May 2010 00:34:23 +0000 (00:34 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 May 2010 00:34:23 +0000 (00:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=39531

Reviewed by Mark Rowe.

Revert r59977 and r59943. These changes caused some exceptions to no longer be
reported in the inspector; I can't tell what they were originally trying to fix
so I am not sure how to fix them other than by reverting.

WebCore:

Covered by existing test platform/mac/fast/AppleScript/001.html, and
also added fast/dom/nested-script-exceptions.html to demonstrate the wider
consequences of the original change.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::ScriptController):
(WebCore::ScriptController::evaluateInWorld):
* bindings/js/ScriptController.h:

LayoutTests:

Unskipped the test that was broken, and also added a new test.

* fast/dom/nested-script-exceptions-expected.txt: Added.
* fast/dom/nested-script-exceptions.html: Added. Shows that inspector functionality
would break in a meaningful way if the reverted change was allowed to stand.
* platform/mac/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60026 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/nested-script-exceptions-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/nested-script-exceptions.html [new file with mode: 0644]
LayoutTests/platform/mac/Skipped
WebCore/ChangeLog
WebCore/bindings/js/ScriptController.cpp
WebCore/bindings/js/ScriptController.h

index c147174..44ccebd 100644 (file)
@@ -1,3 +1,21 @@
+2010-05-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        REGRESSION(r59977): platform/mac/fast/AppleScript/001.html failure
+        https://bugs.webkit.org/show_bug.cgi?id=39531
+
+        Revert r59977 and r59943. These changes caused some exceptions to no longer be
+        reported in the inspector; I can't tell what they were originally trying to fix
+        so I am not sure how to fix them other than by reverting.
+
+        Unskipped the test that was broken, and also added a new test.
+        
+        * fast/dom/nested-script-exceptions-expected.txt: Added.
+        * fast/dom/nested-script-exceptions.html: Added. Shows that inspector functionality
+        would break in a meaningful way if the reverted change was allowed to stand.
+        * platform/mac/Skipped:
+
 2010-05-22  Justin Schuh  <jschuh@chromium.org>
 
         Reviewed by Nate Chapin.
diff --git a/LayoutTests/fast/dom/nested-script-exceptions-expected.txt b/LayoutTests/fast/dom/nested-script-exceptions-expected.txt
new file mode 100644 (file)
index 0000000..d0aa705
--- /dev/null
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 0: Badness 10,000
+This test checks that exceptions in nested scripts are logged properly. An exception named "Badness 10,000" should be logged properly.
diff --git a/LayoutTests/fast/dom/nested-script-exceptions.html b/LayoutTests/fast/dom/nested-script-exceptions.html
new file mode 100644 (file)
index 0000000..db8fb67
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<title>Exceptions in nested scripts</title>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+<p>This test checks that exceptions in nested scripts are logged
+properly. An exception named "Badness 10,000" should be logged properly.</p>
+
+<script>document.write("<script>throw 'Badness 10,000'</scr" + "ipt>");</script>
index 2b3cc88..5c8e694 100644 (file)
@@ -195,6 +195,3 @@ storage/indexeddb
 # This port doesn't support DeviceOrientation.
 fast/dom/DeviceOrientation
 fast/dom/Window/window-properties-on-device-orientation.html
-
-# Fails since r59975
-platform/mac/fast/AppleScript/001.html
index 0be8b90..4d6820f 100644 (file)
@@ -1,3 +1,23 @@
+2010-05-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        REGRESSION(r59977): platform/mac/fast/AppleScript/001.html failure
+        https://bugs.webkit.org/show_bug.cgi?id=39531
+
+        Revert r59977 and r59943. These changes caused some exceptions to no longer be
+        reported in the inspector; I can't tell what they were originally trying to fix
+        so I am not sure how to fix them other than by reverting.
+
+        Covered by existing test platform/mac/fast/AppleScript/001.html, and
+        also added fast/dom/nested-script-exceptions.html to demonstrate the wider
+        consequences of the original change.
+        
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::ScriptController):
+        (WebCore::ScriptController::evaluateInWorld):
+        * bindings/js/ScriptController.h:
+
 2010-05-22  Kwang Yul Seo  <skyul@company100.net>
 
         Reviewed by Eric Seidel.
index 2a26b71..3dcbb0b 100644 (file)
@@ -63,7 +63,6 @@ ScriptController::ScriptController(Frame* frame)
     , m_handlerLineNumber(0)
     , m_sourceURL(0)
     , m_inExecuteScript(false)
-    , m_inEvaluateInWorld(false)
     , m_processingTimerCallback(false)
     , m_paused(false)
     , m_allowPopupsFromPlugin(false)
@@ -114,9 +113,6 @@ JSDOMWindowShell* ScriptController::createWindowShell(DOMWrapperWorld* world)
 
 ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld* world, ShouldAllowXSS shouldAllowXSS)
 {
-    bool wasInEvaluateInWorld = m_inEvaluateInWorld;
-    m_inEvaluateInWorld = true;
-
     const SourceCode& jsSourceCode = sourceCode.jsSourceCode();
     String sourceURL = ustringToString(jsSourceCode.provider()->url());
 
@@ -158,15 +154,13 @@ ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode
     // Evaluating the JavaScript could cause the frame to be deallocated
     // so we start the keep alive timer here.
     m_frame->keepAlive();
-    
-    m_inEvaluateInWorld = wasInEvaluateInWorld;
 
     if (comp.complType() == Normal || comp.complType() == ReturnValue) {
         m_sourceURL = savedSourceURL;
         return comp.value();
     }
 
-    if ((comp.complType() == Throw || comp.complType() == Interrupted) && !wasInEvaluateInWorld)
+    if (comp.complType() == Throw || comp.complType() == Interrupted)
         reportException(exec, comp.value());
 
     m_sourceURL = savedSourceURL;
index 0a58f88..877eb9f 100644 (file)
@@ -187,7 +187,6 @@ private:
     const String* m_sourceURL;
 
     bool m_inExecuteScript;
-    bool m_inEvaluateInWorld;
 
     bool m_processingTimerCallback;
     bool m_paused;