REGRESSION(r144617): Wrong usage of overwritten variable in toDOMWindow (V8Binding...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 14:30:44 +0000 (14:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 14:30:44 +0000 (14:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111565

Patch by Marja Hölttä <marja@chromium.org> on 2013-03-06
Reviewed by Jochen Eisinger.

In toDOMWindow, the variable "global" was first nuked, and then used again. This
change was introduced in r144617.

No new tests (no functional changes).

* bindings/v8/V8Binding.cpp:
(WebCore::toDOMWindow):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/V8Binding.cpp

index 39a7cba..8cc8876 100644 (file)
@@ -1,3 +1,18 @@
+2013-03-06  Marja Hölttä  <marja@chromium.org>
+
+        REGRESSION(r144617): Wrong usage of overwritten variable in toDOMWindow (V8Binding.cpp)
+        https://bugs.webkit.org/show_bug.cgi?id=111565
+
+        Reviewed by Jochen Eisinger.
+
+        In toDOMWindow, the variable "global" was first nuked, and then used again. This
+        change was introduced in r144617.
+
+        No new tests (no functional changes).
+
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::toDOMWindow):
+
 2013-03-06  Yury Semikhatsky  <yurys@chromium.org>
 
         Web Inspector: use regular eval instead of injectScript for front-end extension API
index 924c780..c5053ba 100644 (file)
@@ -221,12 +221,12 @@ DOMWindow* toDOMWindow(v8::Handle<v8::Context> context)
 {
     v8::Handle<v8::Object> global = context->Global();
     ASSERT(!global.IsEmpty());
-    global = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate(), MainWorld));
-    if (!global.IsEmpty())
-        return V8DOMWindow::toNative(global);
-    global = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate(), IsolatedWorld));
-    ASSERT(!global.IsEmpty());
-    return V8DOMWindow::toNative(global);
+    v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate(), MainWorld));
+    if (!window.IsEmpty())
+        return V8DOMWindow::toNative(window);
+    window = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate(), IsolatedWorld));
+    ASSERT(!window.IsEmpty());
+    return V8DOMWindow::toNative(window);
 }
 
 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context> context)