Skip to content
  • haraken@chromium.org's avatar
    [JSC] MAYBE_MISSING_PARAMETER(..., DefaultIsNullString) macro is redundant · 6b1b1de7
    haraken@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=109902
    
    Reviewed by Adam Barth.
    
    Currently:
    
    - MAYBE_MISSING_PARAMETER(exec, index, DefaultIsUndefined)
      returns exec->argument(index).
    - MAYBE_MISSING_PARAMETER(exec, index, DefaultIsNullString)
      returns JSValue() if exec->argument(index) is missing
      (i.e. the length of the argument is less than index).
      It returns exec->argument(index) otherwise.
    
    No one other than CodeGeneratorJS.pm uses
    MAYBE_MISSING_PARAMETER(exec, index, DefaultIsUndefined).
    Instead, we simply use exec->argument(index). We should remove
    the redundant usage in CodeGeneratorJS.pm too. The long-name macro
    has been making generated code less readable.
    
    In addition, we can rename MAYBE_MISSING_PARAMETER() to argumentOrNull().
    
    c.f. corresponding V8 bug: https://bugs.webkit.org/show_bug.cgi?id=109899
    
    No tests. No change in behavior.
    
    * bindings/js/JSDOMBinding.h:
    (WebCore):
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateParametersCheck):
    * bindings/scripts/test/JS/JSFloat64Array.cpp:
    (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::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::jsTestObjPrototypeFunctionVoidMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
    (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
    (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
    (WebCore::jsTestObjPrototypeFunctionSerializedValue):
    (WebCore::jsTestObjPrototypeFunctionOptionsObject):
    (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
    (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
    (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
    (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
    (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
    (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
    (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
    (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
    (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
    (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
    (WebCore::jsTestObjPrototypeFunctionConvert1):
    (WebCore::jsTestObjPrototypeFunctionConvert2):
    (WebCore::jsTestObjPrototypeFunctionConvert4):
    (WebCore::jsTestObjPrototypeFunctionConvert5):
    (WebCore::jsTestObjPrototypeFunctionStrictFunction):
    (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
    (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
    (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
    * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
    (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors1):
    (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors2):
    (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors3):
    (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
    * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
    (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
    (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
    (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList):
    * bindings/scripts/test/JS/JSTestTypedefs.cpp:
    (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
    (WebCore::jsTestTypedefsPrototypeFunctionFunc):
    (WebCore::jsTestTypedefsPrototypeFunctionMultiTransferList):
    (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
    (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
    (WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
    (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
    (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    6b1b1de7