IDL overloads should not treat wrapper types as nullable by default
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 01:08:24 +0000 (01:08 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 01:08:24 +0000 (01:08 +0000)
commit112ad74b9d856d572b02f1f8739affd95e87174a
tree188a297a6f9f97c5bff0688186f8c83c154dfe31
parent5fadf17d7cc69af84291c52454fbb24fa6e314ae
IDL overloads should not treat wrapper types as nullable by default
https://bugs.webkit.org/show_bug.cgi?id=90218

Reviewed by Kentaro Hara.

Wrapper types were being treated as Nullable by default during overloaded
method dispatching, which deviates from the WebIDL specification. This change
introduces the "?" type suffix into the parser, and treats wrapper types
only nullable if specified. (The behavior of array types and other non-wrapper
types are not changed, and only overloaded methods are checked.)

IDL files with affected overloads are modified to include the "?" suffix
so that no behavior changes are introduced by this patch - the JS and V8
generator results before/after the change show no diffs.

Test: bindings/scripts/test/TestObj.idl (a non-nullable overload)

* Modules/indexeddb/IDBDatabase.idl: Added "?" where necessary.
* Modules/indexeddb/IDBIndex.idl: Added "?" where necessary.
* Modules/indexeddb/IDBObjectStore.idl: Added "?" where necessary.
* Modules/webaudio/AudioContext.idl: Added "?" where necessary.
* Modules/webaudio/AudioNode.idl: Added "?" where necessary.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheckExpression): Add isNullable check.
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateParametersCheckExpression): Add isNullable check.
* bindings/scripts/IDLParser.pm: Parse/set isNullable.
(parseParameters):
* bindings/scripts/IDLStructure.pm: Add basic type suffix parsing.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
(WebCore):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
* bindings/scripts/test/TestObj.idl: Mark previous overload params with ?, add new one without.
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::overloadedMethod8Callback):
(TestObjV8Internal):
(WebCore::TestObjV8Internal::overloadedMethodCallback):
* dom/DataTransferItemList.idl: Added "?" where necessary.
* fileapi/WebKitBlobBuilder.idl: Added "?" where necessary.
* html/DOMURL.idl: Added "?" where necessary.
* html/canvas/CanvasRenderingContext2D.idl: Added "?" where necessary.
* html/canvas/WebGLRenderingContext.idl: Added "?" where necessary.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.idl
Source/WebCore/Modules/indexeddb/IDBIndex.idl
Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
Source/WebCore/Modules/webaudio/AudioContext.idl
Source/WebCore/Modules/webaudio/AudioNode.idl
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/IDLStructure.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/dom/DataTransferItemList.idl
Source/WebCore/fileapi/WebKitBlobBuilder.idl
Source/WebCore/html/DOMURL.idl
Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
Source/WebCore/html/canvas/WebGLRenderingContext.idl