[V8] Remove [TreatReturnedNullAs=False]
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 00:55:37 +0000 (00:55 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 00:55:37 +0000 (00:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93835

Reviewed by Adam Barth.

[TreatReturnedNullAs=False] is neither defined in the Web IDL spec
nor used in any WebKit IDL file.

No tests. No change in behavior.

* WebCore.order:
* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
(WebCore):
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue):
* bindings/scripts/CodeGeneratorV8.pm:
(NativeToJSValue):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore):
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::ConfigureV8TestObjTemplate):
* bindings/v8/V8Binding.h:

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

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.order
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/v8/V8Binding.h

index f7e2540..38b3523 100644 (file)
@@ -1,5 +1,41 @@
 2012-08-13  Kentaro Hara  <haraken@chromium.org>
 
+        [V8] Remove [TreatReturnedNullAs=False]
+        https://bugs.webkit.org/show_bug.cgi?id=93835
+
+        Reviewed by Adam Barth.
+
+        [TreatReturnedNullAs=False] is neither defined in the Web IDL spec
+        nor used in any WebKit IDL file.
+
+        No tests. No change in behavior.
+
+        * WebCore.order:
+        * bindings/js/JSDOMBinding.cpp:
+        * bindings/js/JSDOMBinding.h:
+        (WebCore):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NativeToJSValue):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (NativeToJSValue):
+        * bindings/scripts/IDLAttributes.txt:
+        * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+        * bindings/scripts/test/CPP/WebDOMTestObj.h:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        (WebCore):
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::ConfigureV8TestObjTemplate):
+        * bindings/v8/V8Binding.h:
+
+2012-08-13  Kentaro Hara  <haraken@chromium.org>
+
         [V8] Rename v8ValueToWebCoreDOMStringList() to toDOMStringList()
         https://bugs.webkit.org/show_bug.cgi?id=93839
 
index 9d9022c..0b2b175 100644 (file)
@@ -14468,7 +14468,6 @@ __ZN7WebCore44jsDocumentPrototypeFunctionQueryCommandValueEPN3JSC9ExecStateE
 __ZN7WebCore8Document17queryCommandValueERKN3WTF6StringE
 __ZNK7WebCore6Editor7Command5valueEPNS_5EventE
 __ZN7WebCoreL17stateStyleWithCSSEPNS_5FrameEPNS_5EventE
-__ZN7WebCore15jsStringOrFalseEPN3JSC9ExecStateERKN3WTF6StringE
 __ZN7WebCoreL19executeStyleWithCSSEPNS_5FrameEPNS_5EventENS_19EditorCommandSourceERKN3WTF6StringE
 __ZNK7WebCore18HTMLDocumentParser17isExecutingScriptEv
 __ZNK7WebCore5Range21compareBoundaryPointsENS0_10CompareHowEPKS0_Ri
index ba5c90e..1550f99 100644 (file)
@@ -76,13 +76,6 @@ JSValue jsStringOrUndefined(ExecState* exec, const String& s)
     return jsString(exec, s);
 }
 
-JSValue jsStringOrFalse(ExecState* exec, const String& s)
-{
-    if (s.isNull())
-        return jsBoolean(false);
-    return jsString(exec, s);
-}
-
 JSValue jsString(ExecState* exec, const KURL& url)
 {
     return jsString(exec, url.string());
@@ -102,13 +95,6 @@ JSValue jsStringOrUndefined(ExecState* exec, const KURL& url)
     return jsString(exec, url.string());
 }
 
-JSValue jsStringOrFalse(ExecState* exec, const KURL& url)
-{
-    if (url.isNull())
-        return jsBoolean(false);
-    return jsString(exec, url.string());
-}
-
 AtomicStringImpl* findAtomicString(PropertyName propertyName)
 {
     StringImpl* impl = propertyName.publicName();
index 991d8c1..1c8716e 100644 (file)
@@ -247,9 +247,6 @@ enum ParameterDefaultPolicy {
     JSC::JSValue jsStringOrUndefined(JSC::ExecState*, const String&); // undefined if the string is null
     JSC::JSValue jsStringOrUndefined(JSC::ExecState*, const KURL&); // undefined if the URL is null
 
-    JSC::JSValue jsStringOrFalse(JSC::ExecState*, const String&); // boolean false if the string is null
-    JSC::JSValue jsStringOrFalse(JSC::ExecState*, const KURL&); // boolean false if the URL is null
-
     // See JavaScriptCore for explanation: Should be used for any string that is already owned by another
     // object, to let the engine know that collecting the JSString wrapper is unlikely to save memory.
     JSC::JSValue jsOwnedStringOrNull(JSC::ExecState*, const String&); 
index 60d96cc..3024b03 100644 (file)
@@ -3118,7 +3118,6 @@ sub NativeToJSValue
         if (defined $conv) {
             return "jsStringOrNull(exec, $value)" if $conv eq "Null";
             return "jsStringOrUndefined(exec, $value)" if $conv eq "Undefined";
-            return "jsStringOrFalse(exec, $value)" if $conv eq "False";
 
             die "Unknown value for TreatReturnedNullStringAs extended attribute";
         }
index dbf6695..2c45b0e 100644 (file)
@@ -4055,7 +4055,6 @@ sub NativeToJSValue
         if (defined $conv) {
             return "v8StringOrNull($value$getIsolateArg)" if $conv eq "Null";
             return "v8StringOrUndefined($value$getIsolateArg)" if $conv eq "Undefined";
-            return "v8StringOrFalse($value$getIsolateArg)" if $conv eq "False";
 
             die "Unknown value for TreatReturnedNullStringAs extended attribute";
         }
index 889e107..38de69d 100644 (file)
@@ -104,7 +104,7 @@ Supplemental=*
 SuppressToJSObject
 TransferList=*
 TreatNullAs=NullString
-TreatReturnedNullStringAs=False|Null|Undefined
+TreatReturnedNullStringAs=Null|Undefined
 TreatUndefinedAs=NullString
 TypedArray=*
 URL
index a93f968..aa81195 100644 (file)
@@ -37,7 +37,6 @@
 #include "WebDOMa.h"
 #include "WebDOMb.h"
 #include "WebDOMbool.h"
-#include "WebDOMc.h"
 #include "WebDOMd.h"
 #include "WebDOMe.h"
 #include "WebExceptionHandler.h"
@@ -45,7 +44,6 @@
 #include "a.h"
 #include "b.h"
 #include "bool.h"
-#include "c.h"
 #include "d.h"
 #include "e.h"
 #include "wtf/text/AtomicString.h"
@@ -902,14 +900,6 @@ void WebDOMTestObj::convert2(const WebDOMb& )
     impl()->convert2(toWebCore());
 }
 
-void WebDOMTestObj::convert3(const WebDOMc& )
-{
-    if (!impl())
-        return;
-
-    impl()->convert3(toWebCore());
-}
-
 void WebDOMTestObj::convert4(const WebDOMd& )
 {
     if (!impl())
index bd373d8..00f0600 100644 (file)
@@ -40,7 +40,6 @@ class WebDOMTestObj;
 class WebDOMa;
 class WebDOMb;
 class WebDOMbool;
-class WebDOMc;
 class WebDOMd;
 class WebDOMe;
 
@@ -182,7 +181,6 @@ public:
 #endif
     void convert1(const WebDOMa& );
     void convert2(const WebDOMb& );
-    void convert3(const WebDOMc& );
     void convert4(const WebDOMd& );
     void convert5(const WebDOMe& );
     WebDOMSVGPoint mutablePointFunction();
index 5e2bde4..cefbc04 100644 (file)
@@ -48,8 +48,6 @@
 #include "webkit/WebKitDOMbPrivate.h"
 #include "webkit/WebKitDOMbool.h"
 #include "webkit/WebKitDOMboolPrivate.h"
-#include "webkit/WebKitDOMc.h"
-#include "webkit/WebKitDOMcPrivate.h"
 #include "webkit/WebKitDOMd.h"
 #include "webkit/WebKitDOMdPrivate.h"
 #include "webkit/WebKitDOMe.h"
@@ -1360,21 +1358,6 @@ webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMb* )
 }
 
 void
-webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, WebKitDOMc* )
-{
-    g_return_if_fail(self);
-    WebCore::JSMainThreadNullState state;
-    WebCore::TestObj* item = WebKit::core(self);
-    g_return_if_fail();
-    WebCore::c* converted = 0;
-    if () {
-        converted = WebKit::core();
-        g_return_if_fail(converted);
-    }
-    item->convert3(converted);
-}
-
-void
 webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMd* )
 {
     g_return_if_fail(self);
index b8d57de..46b85d0 100644 (file)
@@ -420,17 +420,6 @@ WEBKIT_API void
 webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMb* );
 
 /**
- * webkit_dom_test_obj_convert3:
- * @self: A #WebKitDOMTestObj
- * @: A #WebKitDOMc
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, WebKitDOMc* );
-
-/**
  * webkit_dom_test_obj_convert4:
  * @self: A #WebKitDOMTestObj
  * @: A #WebKitDOMd
index c7f790a..18affcc 100644 (file)
@@ -41,7 +41,6 @@
 #include "JSa.h"
 #include "JSb.h"
 #include "JSbool.h"
-#include "JSc.h"
 #include "JSd.h"
 #include "JSe.h"
 #include "KURL.h"
@@ -314,7 +313,6 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { "getSVGDocument", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t)0, NoIntrinsic },
     { "convert1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t)1, NoIntrinsic },
     { "convert2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t)1, NoIntrinsic },
-    { "convert3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t)1, NoIntrinsic },
     { "convert4", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t)1, NoIntrinsic },
     { "convert5", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t)1, NoIntrinsic },
     { "mutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t)0, NoIntrinsic },
@@ -324,7 +322,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { 0, 0, 0, 0, NoIntrinsic }
 };
 
-static const HashTable JSTestObjPrototypeTable = { 267, 255, JSTestObjPrototypeTableValues, 0 };
+static const HashTable JSTestObjPrototypeTable = { 266, 255, JSTestObjPrototypeTableValues, 0 };
 const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
 
 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -2486,23 +2484,6 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec)
     return JSValue::encode(jsUndefined());
 }
 
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* exec)
-{
-    JSValue thisValue = exec->hostThisValue();
-    if (!thisValue.inherits(&JSTestObj::s_info))
-        return throwVMTypeError(exec);
-    JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
-    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
-    TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    if (exec->argumentCount() < 1)
-        return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    c* (toc(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
-    if (exec->hadException())
-        return JSValue::encode(jsUndefined());
-    impl->convert3();
-    return JSValue::encode(jsUndefined());
-}
-
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec)
 {
     JSValue thisValue = exec->hostThisValue();
index ddcfe5d..76549d4 100644 (file)
@@ -209,7 +209,6 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStringArrayFunction(
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(JSC::ExecState*);
index 42e54ca..3696811 100644 (file)
@@ -40,7 +40,6 @@
 @class DOMa;
 @class DOMb;
 @class DOMbool;
-@class DOMc;
 @class DOMd;
 @class DOMe;
 @class NSString;
@@ -220,7 +219,6 @@ enum {
 - (DOMSVGDocument *)getSVGDocument;
 - (void)convert1:(DOMa *);
 - (void)convert2:(DOMb *);
-- (void)convert3:(DOMc *);
 - (void)convert4:(DOMd *);
 - (void)convert5:(DOMe *);
 - (DOMSVGPoint *)mutablePointFunction;
index d08611c..4bd0401 100644 (file)
@@ -47,7 +47,6 @@
 #import "DOMaInternal.h"
 #import "DOMbInternal.h"
 #import "DOMboolInternal.h"
-#import "DOMcInternal.h"
 #import "DOMdInternal.h"
 #import "DOMeInternal.h"
 #import "Dictionary.h"
@@ -72,7 +71,6 @@
 #import "a.h"
 #import "b.h"
 #import "bool.h"
-#import "c.h"
 #import "d.h"
 #import "e.h"
 #import <wtf/GetPtr.h>
     IMPL->convert2(core());
 }
 
-- (void)convert3:(DOMc *)
-{
-    WebCore::JSMainThreadNullState state;
-    IMPL->convert3(core());
-}
-
 - (void)convert4:(DOMd *)
 {
     WebCore::JSMainThreadNullState state;
index 2ca139a..c53ccfd 100644 (file)
@@ -226,7 +226,6 @@ module test {
 
         void convert1(in [TreatReturnedNullStringAs=Null] a);
         void convert2(in [TreatReturnedNullStringAs=Undefined] b);
-        void convert3(in [TreatReturnedNullStringAs=False] c);
         void convert4(in [TreatNullAs=NullString] d);
         void convert5(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] e);
 
index 44b8a6b..2f9ec0e 100644 (file)
@@ -53,7 +53,6 @@
 #include "V8any.h"
 #include "V8b.h"
 #include "V8bool.h"
-#include "V8c.h"
 #include "V8d.h"
 #include "V8e.h"
 #include <wtf/Float32Array.h>
@@ -1858,17 +1857,6 @@ static v8::Handle<v8::Value> convert2Callback(const v8::Arguments& args)
     return v8Undefined();
 }
 
-static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.TestObj.convert3");
-    if (args.Length() < 1)
-        return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
-    TestObj* imp = V8TestObj::toNative(args.Holder());
-    EXCEPTION_BLOCK(c*, , V8c::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8c::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
-    imp->convert3();
-    return v8Undefined();
-}
-
 static v8::Handle<v8::Value> convert4Callback(const v8::Arguments& args)
 {
     INC_STATS("DOM.TestObj.convert4");
@@ -2252,12 +2240,6 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
     v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
     proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
 
-    // Custom Signature 'convert3'
-    const int convert3Argc = 1;
-    v8::Handle<v8::FunctionTemplate> convert3Argv[convert3Argc] = { V8c::GetRawTemplate() };
-    v8::Handle<v8::Signature> convert3Signature = v8::Signature::New(desc, convert3Argc, convert3Argv);
-    proto->Set(v8::String::New("convert3"), v8::FunctionTemplate::New(TestObjV8Internal::convert3Callback, v8Undefined(), convert3Signature));
-
     // Custom Signature 'convert4'
     const int convert4Argc = 1;
     v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
index 113a2a9..ebe1fdd 100644 (file)
@@ -366,11 +366,6 @@ namespace WebCore {
         return str.isNull() ? v8::Handle<v8::Value>(v8::Undefined()) : v8::Handle<v8::Value>(v8String(str, isolate));
     }
 
-    inline v8::Handle<v8::Value> v8StringOrFalse(const String& str, v8::Isolate* isolate = 0)
-    {
-        return str.isNull() ? v8::Handle<v8::Value>(v8Boolean(false)) : v8::Handle<v8::Value>(v8String(str, isolate));
-    }
-
     inline double toWebCoreDate(v8::Handle<v8::Value> object)
     {
         return (object->IsDate() || object->IsNumber()) ? object->NumberValue() : std::numeric_limits<double>::quiet_NaN();