Skip to content
  • haraken@chromium.org's avatar
    [JSC] Implement a helper method createNotEnoughArgumentsError() · aa7bf259
    haraken@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=85102
    
    Reviewed by Geoffrey Garen.
    
    In bug 84787, kbr@ requested to avoid hard-coding
    createTypeError(exec, "Not enough arguments") here and there.
    This patch implements createNotEnoughArgumentsError(exec)
    and uses it in JSC bindings.
    
    c.f. a corresponding bug for V8 bindings is bug 85097.
    
    Source/JavaScriptCore:
    
    * runtime/Error.cpp:
    (JSC::createNotEnoughArgumentsError):
    (JSC):
    * runtime/Error.h:
    (JSC):
    
    Source/WebCore:
    
    Test: bindings/scripts/test/TestObj.idl
    
    * bindings/scripts/CodeGeneratorJS.pm: Modified as described above.
    (GenerateArgumentsCountCheck):
    
    * bindings/js/JSDataViewCustom.cpp: Ditto.
    (WebCore::getDataViewMember):
    (WebCore::setDataViewMember):
    * bindings/js/JSDeprecatedPeerConnectionCustom.cpp:
    (WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection):
    * bindings/js/JSDirectoryEntryCustom.cpp:
    (WebCore::JSDirectoryEntry::getFile):
    (WebCore::JSDirectoryEntry::getDirectory):
    * bindings/js/JSSharedWorkerCustom.cpp:
    (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
    * bindings/js/JSWebKitMutationObserverCustom.cpp:
    (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
    (WebCore::JSWebKitMutationObserver::observe):
    * bindings/js/JSWorkerCustom.cpp:
    (WebCore::JSWorkerConstructor::constructJSWorker):
    
    * bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests.
    (WebCore::jsFloat64ArrayPrototypeFunctionFoo):
    * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
    (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
    (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
    * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
    (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
    * bindings/scripts/test/JS/JSTestEventTarget.cpp:
    (WebCore::jsTestEventTargetPrototypeFunctionItem):
    (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
    (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
    (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
    * bindings/scripts/test/JS/JSTestInterface.cpp:
    (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
    (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
    * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
    (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
    * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
    (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
    * bindings/scripts/test/JS/JSTestObj.cpp:
    (WebCore::JSTestObjConstructor::constructJSTestObj):
    (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
    (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
    (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
    (WebCore::jsTestObjPrototypeFunctionSerializedValue):
    (WebCore::jsTestObjPrototypeFunctionIdbKey):
    (WebCore::jsTestObjPrototypeFunctionOptionsObject):
    (WebCore::jsTestObjPrototypeFunctionAddEventListener):
    (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
    (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
    (WebCore::jsTestObjConstructorFunctionClassMethod2):
    (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
    (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
    (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray):
    (WebCore::jsTestObjPrototypeFunctionConvert1):
    (WebCore::jsTestObjPrototypeFunctionConvert2):
    (WebCore::jsTestObjPrototypeFunctionConvert3):
    (WebCore::jsTestObjPrototypeFunctionConvert4):
    (WebCore::jsTestObjPrototypeFunctionConvert5):
    (WebCore::jsTestObjPrototypeFunctionStrictFunction):
    * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
    (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
    (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    aa7bf259