Skip to content
  • commit-queue@webkit.org's avatar
    [JSC] Implement EnforceRange IDL attribute for integer conversions · 91f1ffcd
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=112506
    
    Patch by Michael Pruett <michael@68k.org> on 2013-03-20
    Reviewed by Kentaro Hara.
    
    .:
    
    * Source/autotools/symbols.filter:
    
    Source/WebCore:
    
    Implement the EnforceRange attribute for JSC bindings.
    
    The EnforceRange attribute requires a type error to be thrown when
    converting an ECMAScript number which is beyond the representable
    range of the IDL integer type.
    
    Tests: fast/js/webidl-type-mapping.html
           storage/indexeddb/cursor-advance-workers.html
           storage/indexeddb/cursor-advance.html
           storage/indexeddb/intversion-bad-parameters.html
    
    * WebCore.exp.in:
    * bindings/js/JSDOMBinding.cpp:
    (WebCore):
    (WebCore::enforceRange):
    (WebCore::toInt32EnforceRange):
    (WebCore::toUInt32EnforceRange):
    (WebCore::toInt64):
    (WebCore::toUInt64):
    * bindings/js/JSDOMBinding.h:
    (WebCore::toInt32):
    (WebCore):
    (WebCore::toUInt32):
    * bindings/scripts/CodeGeneratorJS.pm:
    (JSValueToNative):
    * bindings/scripts/test/JS/JSTestEventTarget.cpp:
    (WebCore::jsTestEventTargetPrototypeFunctionItem):
    * bindings/scripts/test/JS/JSTestObj.cpp:
    (WebCore::setJSTestObjShortAttr):
    (WebCore::setJSTestObjUnsignedShortAttr):
    (WebCore::setJSTestObjLongAttr):
    (WebCore::setJSTestObjLongLongAttr):
    (WebCore::setJSTestObjUnsignedLongLongAttr):
    (WebCore::setJSTestObjReflectedIntegralAttr):
    (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
    (WebCore::setJSTestObjReflectedCustomIntegralAttr):
    (WebCore::setJSTestObjAttrWithGetterException):
    (WebCore::setJSTestObjAttrWithSetterException):
    (WebCore::setJSTestObjWithScriptStateAttribute):
    (WebCore::setJSTestObjConditionalAttr1):
    (WebCore::setJSTestObjConditionalAttr2):
    (WebCore::setJSTestObjConditionalAttr3):
    (WebCore::setJSTestObjStrawberry):
    (WebCore::setJSTestObjId):
    (WebCore::setJSTestObjNullableLongSettableAttribute):
    (WebCore::setJSTestObjNullableStringValue):
    (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
    (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
    (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
    (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
    (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
    (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
    (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
    (WebCore::jsTestObjPrototypeFunctionStrictFunction):
    * bindings/scripts/test/JS/JSTestTypedefs.cpp:
    (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
    (WebCore::setJSTestTypedefsAttrWithGetterException):
    (WebCore::setJSTestTypedefsAttrWithSetterException):
    
    Source/WebKit/win:
    
    * WebKit.vcproj/WebKitExports.def.in:
    
    LayoutTests:
    
    * fast/js/webidl-type-mapping-expected.txt:
    * platform/chromium/fast/js/webidl-type-mapping-expected.txt: Removed.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    91f1ffcd