Align JSC/V8 bindings canvas.toDataURL() code flows
authornoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 03:54:27 +0000 (03:54 +0000)
committernoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 03:54:27 +0000 (03:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84003

Reviewed by Eric Seidel.

Align JSC/V8 bindings canvas.toDataURL() code flow so that the binding
code implementations read alike.

No new tests. Covered by existing cnavas toDataURL tests.

* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::toDataURL):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp

index 6d065e7..ed96770 100644 (file)
@@ -1,3 +1,18 @@
+2012-04-15  Noel Gordon  <noel.gordon@gmail.com>
+
+        Align JSC/V8 bindings canvas.toDataURL() code flows
+        https://bugs.webkit.org/show_bug.cgi?id=84003
+
+        Reviewed by Eric Seidel.
+
+        Align JSC/V8 bindings canvas.toDataURL() code flow so that the binding
+        code implementations read alike.
+
+        No new tests. Covered by existing cnavas toDataURL tests.
+
+        * bindings/js/JSHTMLCanvasElementCustom.cpp:
+        (WebCore::JSHTMLCanvasElement::toDataURL):
+
 2012-04-15  Jia Pu  <jpu@apple.com>
 
         Introducing DictationCommand.
index df1866f..e6e65f9 100644 (file)
@@ -80,11 +80,10 @@ JSValue JSHTMLCanvasElement::getContext(ExecState* exec)
 
 JSValue JSHTMLCanvasElement::toDataURL(ExecState* exec)
 {
-    const String& type = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
     HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl());
     ExceptionCode ec = 0;
-    
-    JSC::JSValue result;
+
+    const String& type = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
     double quality;
     double* qualityPtr = 0;
     if (exec->argumentCount() > 1) {
@@ -95,7 +94,7 @@ JSValue JSHTMLCanvasElement::toDataURL(ExecState* exec)
         }
     }
     
-    result = jsString(exec, canvas->toDataURL(type, qualityPtr, ec));
+    JSValue result = jsString(exec, canvas->toDataURL(type, qualityPtr, ec));
     setDOMException(exec, ec);
     return result;
 }