Title: [123550] trunk/Source/WebCore
Revision
123550
Author
[email protected]
Date
2012-07-24 16:51:23 -0700 (Tue, 24 Jul 2012)

Log Message

[V8] Correct WebIDL type should be used in the testing IDL file
https://bugs.webkit.org/show_bug.cgi?id=92168

Reviewed by Kentaro Hara.

Updated bindings test.

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_strict_function):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionStrictFunction):
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback):
(WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback):
(WebCore::TestObjV8Internal::enabledPerContextMethod1Callback):
(WebCore::TestObjV8Internal::enabledPerContextMethod2Callback):
(WebCore::TestObjV8Internal::strictFunctionCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123549 => 123550)


--- trunk/Source/WebCore/ChangeLog	2012-07-24 23:38:30 UTC (rev 123549)
+++ trunk/Source/WebCore/ChangeLog	2012-07-24 23:51:23 UTC (rev 123550)
@@ -1,3 +1,25 @@
+2012-07-24  Jian Li  <[email protected]>
+
+        [V8] Correct WebIDL type should be used in the testing IDL file 
+        https://bugs.webkit.org/show_bug.cgi?id=92168
+
+        Reviewed by Kentaro Hara.
+
+        Updated bindings test.
+
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        (webkit_dom_test_obj_strict_function):
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionStrictFunction):
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback):
+        (WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback):
+        (WebCore::TestObjV8Internal::enabledPerContextMethod1Callback):
+        (WebCore::TestObjV8Internal::enabledPerContextMethod2Callback):
+        (WebCore::TestObjV8Internal::strictFunctionCallback):
+
 2012-07-24  Kent Tamura  <[email protected]>
 
         Unreviewed, rolling out r123191.

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (123549 => 123550)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp	2012-07-24 23:38:30 UTC (rev 123549)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp	2012-07-24 23:51:23 UTC (rev 123550)
@@ -1436,7 +1436,7 @@
 }
 
 WebKitDOMbool*
-webkit_dom_test_obj_strict_function(WebKitDOMTestObj* self, const gchar* str, gfloat a, gint b, GError** error)
+webkit_dom_test_obj_strict_function(WebKitDOMTestObj* self, const gchar* str, gfloat a, glong b, GError** error)
 {
     g_return_val_if_fail(self, 0);
     WebCore::JSMainThreadNullState state;

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (123549 => 123550)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h	2012-07-24 23:38:30 UTC (rev 123549)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h	2012-07-24 23:51:23 UTC (rev 123550)
@@ -487,14 +487,14 @@
  * @self: A #WebKitDOMTestObj
  * @str: A #gchar
  * @a: A #gfloat
- * @b: A #gint
+ * @b: A #glong
  * @error: #GError
  *
  * Returns: (transfer none):
  *
 **/
 WEBKIT_API WebKitDOMbool*
-webkit_dom_test_obj_strict_function(WebKitDOMTestObj* self, const gchar* str, gfloat a, gint b, GError** error);
+webkit_dom_test_obj_strict_function(WebKitDOMTestObj* self, const gchar* str, gfloat a, glong b, GError** error);
 
 /**
  * webkit_dom_test_obj_get_read_only_int_attr:

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (123549 => 123550)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2012-07-24 23:38:30 UTC (rev 123549)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2012-07-24 23:51:23 UTC (rev 123550)
@@ -2530,9 +2530,7 @@
     float a(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toFloat(exec));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
-    if (exec->argumentCount() > 2 && !exec->argument(2).isUndefinedOrNull() && !exec->argument(2).inherits(&JSint::s_info))
-        return throwVMTypeError(exec);
-    int* b(toint(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
+    int b(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined).toInt32(exec));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (123549 => 123550)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2012-07-24 23:38:30 UTC (rev 123549)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2012-07-24 23:51:23 UTC (rev 123550)
@@ -190,13 +190,13 @@
 
 #if defined(TESTING_V8)
         // 'V8EnabledAtRuntime' methods and attributes.
-        [V8EnabledAtRuntime] void enabledAtRuntimeMethod1(in int intArg);
-        [V8EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in int intArg);
+        [V8EnabledAtRuntime] void enabledAtRuntimeMethod1(in long longArg);
+        [V8EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in long longArg);
         attribute [V8EnabledAtRuntime] long enabledAtRuntimeAttr1;
         attribute [V8EnabledAtRuntime=FeatureName] long enabledAtRuntimeAttr2;
         // 'V8EnabledPerContext' methods and attributes.
-        [V8EnabledPerContext] void enabledPerContextMethod1(in int intArg);
-        [V8EnabledPerContext=FeatureName] void enabledPerContextMethod2(in int intArg);
+        [V8EnabledPerContext] void enabledPerContextMethod1(in long longArg);
+        [V8EnabledPerContext=FeatureName] void enabledPerContextMethod2(in long longArg);
         attribute [V8EnabledPerContext] long enabledPerContextAttr1;
         attribute [V8EnabledPerContext=FeatureName] long enabledPerContextAttr2;
 #endif
@@ -233,7 +233,7 @@
         attribute [ImplementedAs=blueberry] int strawberry;
 
         attribute [StrictTypeChecking] float strictFloat;
-        [StrictTypeChecking] bool strictFunction(in DOMString str, in float a, in int b)
+        [StrictTypeChecking] bool strictFunction(in DOMString str, in float a, in long b)
             raises(DOMException);
 
         // ObjectiveC reserved words.

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (123549 => 123550)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp	2012-07-24 23:38:30 UTC (rev 123549)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp	2012-07-24 23:51:23 UTC (rev 123550)
@@ -1728,8 +1728,8 @@
     if (args.Length() < 1)
         return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
-    imp->enabledAtRuntimeMethod1(intArg);
+    EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+    imp->enabledAtRuntimeMethod1(Arg);
     return v8::Handle<v8::Value>();
 }
 
@@ -1739,8 +1739,8 @@
     if (args.Length() < 1)
         return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
-    imp->enabledAtRuntimeMethod2(intArg);
+    EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+    imp->enabledAtRuntimeMethod2(Arg);
     return v8::Handle<v8::Value>();
 }
 
@@ -1750,8 +1750,8 @@
     if (args.Length() < 1)
         return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
-    imp->enabledPerContextMethod1(intArg);
+    EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+    imp->enabledPerContextMethod1(Arg);
     return v8::Handle<v8::Value>();
 }
 
@@ -1761,8 +1761,8 @@
     if (args.Length() < 1)
         return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
     TestObj* imp = V8TestObj::toNative(args.Holder());
-    EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
-    imp->enabledPerContextMethod2(intArg);
+    EXCEPTION_BLOCK(long long, Arg, toInt64(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
+    imp->enabledPerContextMethod2(Arg);
     return v8::Handle<v8::Value>();
 }
 
@@ -1888,7 +1888,7 @@
     {
     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
     EXCEPTION_BLOCK(float, a, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
-    EXCEPTION_BLOCK(int, b, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined))) : 0);
+    EXCEPTION_BLOCK(int, b, toInt32(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)));
     RefPtr<bool> result = imp->strictFunction(str, a, b, ec);
     if (UNLIKELY(ec))
         goto fail;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to