Changeset 89315 in webkit


Ignore:
Timestamp:
Jun 20, 2011 4:54:07 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-06-20 Mark Pilgrim <pilgrim@chromium.org>

Reviewed by Adam Barth.

IDL generator should throw TypeError instead of SyntaxError on not enough arguments
https://bugs.webkit.org/show_bug.cgi?id=63011

To align with WebIDL, we should throw TypeError whenever a function
is called with missing required arguments.

  • fast/canvas/canvas-overloads-drawImageFromRect-expected.txt:
  • fast/canvas/canvas-overloads-fillText-expected.txt:
  • fast/canvas/canvas-overloads-strokeText-expected.txt:
  • fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js:
  • fast/canvas/script-tests/canvas-overloads-fillText.js:
  • fast/canvas/script-tests/canvas-overloads-strokeText.js:
  • fast/canvas/webgl/data-view-test-expected.txt:
  • http/tests/xmlhttprequest/exceptions-expected.txt:
  • platform/chromium-mac/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
  • platform/chromium-win/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
  • svg/dom/SVGAngle-expected.txt:
  • svg/dom/SVGColor-expected.txt:
  • svg/dom/SVGLength-expected.txt:
  • svg/dom/SVGLengthList-basics-expected.txt:
  • svg/dom/SVGMatrix-expected.txt:
  • svg/dom/SVGNumberList-basics-expected.txt:
  • svg/dom/SVGPaint-expected.txt:
  • svg/dom/SVGPoint-expected.txt:
  • svg/dom/SVGPointList-basics-expected.txt:
  • svg/dom/SVGStringList-basics-expected.txt:
  • svg/dom/SVGTransform-expected.txt:
  • svg/dom/SVGTransformList-basics-expected.txt:
  • svg/dom/SVGTransformList-expected.txt:
  • svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:

2011-06-20 Mark Pilgrim <pilgrim@chromium.org>

Reviewed by Adam Barth.

IDL generator should throw TypeError instead of SyntaxError on not enough arguments
https://bugs.webkit.org/show_bug.cgi?id=63011

To align with WebIDL, we should throw TypeError whenever a function
is called with missing required arguments.

  • bindings/scripts/CodeGeneratorJS.pm:
  • bindings/scripts/CodeGeneratorV8.pm:
  • bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback):
Location:
trunk
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89314 r89315  
     12011-06-20  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        IDL generator should throw TypeError instead of SyntaxError on not enough arguments
     6        https://bugs.webkit.org/show_bug.cgi?id=63011
     7
     8        To align with WebIDL, we should throw TypeError whenever a function
     9        is called with missing required arguments.
     10
     11        * fast/canvas/canvas-overloads-drawImageFromRect-expected.txt:
     12        * fast/canvas/canvas-overloads-fillText-expected.txt:
     13        * fast/canvas/canvas-overloads-strokeText-expected.txt:
     14        * fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js:
     15        * fast/canvas/script-tests/canvas-overloads-fillText.js:
     16        * fast/canvas/script-tests/canvas-overloads-strokeText.js:
     17        * fast/canvas/webgl/data-view-test-expected.txt:
     18        * http/tests/xmlhttprequest/exceptions-expected.txt:
     19        * platform/chromium-mac/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
     20        * platform/chromium-win/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
     21        * svg/dom/SVGAngle-expected.txt:
     22        * svg/dom/SVGColor-expected.txt:
     23        * svg/dom/SVGLength-expected.txt:
     24        * svg/dom/SVGLengthList-basics-expected.txt:
     25        * svg/dom/SVGMatrix-expected.txt:
     26        * svg/dom/SVGNumberList-basics-expected.txt:
     27        * svg/dom/SVGPaint-expected.txt:
     28        * svg/dom/SVGPoint-expected.txt:
     29        * svg/dom/SVGPointList-basics-expected.txt:
     30        * svg/dom/SVGStringList-basics-expected.txt:
     31        * svg/dom/SVGTransform-expected.txt:
     32        * svg/dom/SVGTransformList-basics-expected.txt:
     33        * svg/dom/SVGTransformList-expected.txt:
     34        * svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
     35
    1362011-05-03  Martin Robinson  <mrobinson@igalia.com>
    237
  • trunk/LayoutTests/fast/canvas/canvas-overloads-drawImageFromRect-expected.txt

    r87735 r89315  
    44
    55
    6 PASS ctx.drawImageFromRect() threw exception SyntaxError: Not enough arguments.
     6PASS ctx.drawImageFromRect() threw exception TypeError: Not enough arguments.
    77PASS ctx.drawImageFromRect(imageElement) is undefined
    88PASS ctx.drawImageFromRect(imageElement, 0) is undefined
  • trunk/LayoutTests/fast/canvas/canvas-overloads-fillText-expected.txt

    r87729 r89315  
    44
    55
    6 PASS ctx.fillText() threw exception SyntaxError: Not enough arguments.
    7 PASS ctx.fillText('moo') threw exception SyntaxError: Not enough arguments.
    8 PASS ctx.fillText('moo',0) threw exception SyntaxError: Not enough arguments.
     6PASS ctx.fillText() threw exception TypeError: Not enough arguments.
     7PASS ctx.fillText('moo') threw exception TypeError: Not enough arguments.
     8PASS ctx.fillText('moo',0) threw exception TypeError: Not enough arguments.
    99PASS ctx.fillText('moo',0,0) is undefined
    1010PASS ctx.fillText('moo',0,0,0) is undefined
  • trunk/LayoutTests/fast/canvas/canvas-overloads-strokeText-expected.txt

    r87730 r89315  
    44
    55
    6 PASS ctx.strokeText() threw exception SyntaxError: Not enough arguments.
    7 PASS ctx.strokeText('moo') threw exception SyntaxError: Not enough arguments.
    8 PASS ctx.strokeText('moo',0) threw exception SyntaxError: Not enough arguments.
     6PASS ctx.strokeText() threw exception TypeError: Not enough arguments.
     7PASS ctx.strokeText('moo') threw exception TypeError: Not enough arguments.
     8PASS ctx.strokeText('moo',0) threw exception TypeError: Not enough arguments.
    99PASS ctx.strokeText('moo',0,0) is undefined
    1010PASS ctx.strokeText('moo',0,0,0) is undefined
  • trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js

    r87735 r89315  
    33var ctx = document.createElement('canvas').getContext('2d');
    44
    5 var SyntaxError = "SyntaxError: Not enough arguments";
     5var NotEnoughArguments = "TypeError: Not enough arguments";
    66
    77var imageElement = document.createElement("img");
    8 shouldThrow("ctx.drawImageFromRect()", "SyntaxError");
     8shouldThrow("ctx.drawImageFromRect()", "NotEnoughArguments");
    99shouldBe("ctx.drawImageFromRect(imageElement)", "undefined");
    1010shouldBe("ctx.drawImageFromRect(imageElement, 0)", "undefined");
  • trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js

    r87729 r89315  
    33var ctx = document.createElement('canvas').getContext('2d');
    44
    5 var SyntaxError = "SyntaxError: Not enough arguments";
     5var NotEnoughArguments = "TypeError: Not enough arguments";
    66var TypeError = "TypeError: Type error";
    77
    8 shouldThrow("ctx.fillText()", "SyntaxError");
    9 shouldThrow("ctx.fillText('moo')", "SyntaxError");
    10 shouldThrow("ctx.fillText('moo',0)", "SyntaxError");
     8shouldThrow("ctx.fillText()", "NotEnoughArguments");
     9shouldThrow("ctx.fillText('moo')", "NotEnoughArguments");
     10shouldThrow("ctx.fillText('moo',0)", "NotEnoughArguments");
    1111shouldBe("ctx.fillText('moo',0,0)", "undefined");
    1212shouldBe("ctx.fillText('moo',0,0,0)", "undefined");
  • trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeText.js

    r87730 r89315  
    33var ctx = document.createElement('canvas').getContext('2d');
    44
    5 var SyntaxError = "SyntaxError: Not enough arguments";
     5var NotEnoughArguments = "TypeError: Not enough arguments";
    66
    7 shouldThrow("ctx.strokeText()", "SyntaxError");
    8 shouldThrow("ctx.strokeText('moo')", "SyntaxError");
    9 shouldThrow("ctx.strokeText('moo',0)", "SyntaxError");
     7shouldThrow("ctx.strokeText()", "NotEnoughArguments");
     8shouldThrow("ctx.strokeText('moo')", "NotEnoughArguments");
     9shouldThrow("ctx.strokeText('moo',0)", "NotEnoughArguments");
    1010shouldBe("ctx.strokeText('moo',0,0)", "undefined");
    1111shouldBe("ctx.strokeText('moo',0,0,0)", "undefined");
  • trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt

    r78738 r89315  
    302302PASS view.getInt8() threw exception SyntaxError: Not enough arguments.
    303303PASS view.getUint8() threw exception SyntaxError: Not enough arguments.
    304 PASS view.getInt16() threw exception SyntaxError: Not enough arguments.
    305 PASS view.getUint16() threw exception SyntaxError: Not enough arguments.
    306 PASS view.getInt32() threw exception SyntaxError: Not enough arguments.
    307 PASS view.getUint32() threw exception SyntaxError: Not enough arguments.
    308 PASS view.getFloat32() threw exception SyntaxError: Not enough arguments.
    309 PASS view.getFloat64() threw exception SyntaxError: Not enough arguments.
     304PASS view.getInt16() threw exception TypeError: Not enough arguments.
     305PASS view.getUint16() threw exception TypeError: Not enough arguments.
     306PASS view.getInt32() threw exception TypeError: Not enough arguments.
     307PASS view.getUint32() threw exception TypeError: Not enough arguments.
     308PASS view.getFloat32() threw exception TypeError: Not enough arguments.
     309PASS view.getFloat64() threw exception TypeError: Not enough arguments.
    310310
    311311Test for set methods that work
     
    792792PASS view.setInt8() threw exception SyntaxError: Not enough arguments.
    793793PASS view.setUint8() threw exception SyntaxError: Not enough arguments.
    794 PASS view.setInt16() threw exception SyntaxError: Not enough arguments.
    795 PASS view.setUint16() threw exception SyntaxError: Not enough arguments.
    796 PASS view.setInt32() threw exception SyntaxError: Not enough arguments.
    797 PASS view.setUint32() threw exception SyntaxError: Not enough arguments.
    798 PASS view.setFloat32() threw exception SyntaxError: Not enough arguments.
    799 PASS view.setFloat64() threw exception SyntaxError: Not enough arguments.
     794PASS view.setInt16() threw exception TypeError: Not enough arguments.
     795PASS view.setUint16() threw exception TypeError: Not enough arguments.
     796PASS view.setInt32() threw exception TypeError: Not enough arguments.
     797PASS view.setUint32() threw exception TypeError: Not enough arguments.
     798PASS view.setFloat32() threw exception TypeError: Not enough arguments.
     799PASS view.setFloat64() threw exception TypeError: Not enough arguments.
    800800PASS view.setInt8(1) threw exception SyntaxError: Not enough arguments.
    801801PASS view.setUint8(1) threw exception SyntaxError: Not enough arguments.
    802 PASS view.setInt16(1) threw exception SyntaxError: Not enough arguments.
    803 PASS view.setUint16(1) threw exception SyntaxError: Not enough arguments.
    804 PASS view.setInt32(1) threw exception SyntaxError: Not enough arguments.
    805 PASS view.setUint32(1) threw exception SyntaxError: Not enough arguments.
    806 PASS view.setFloat32(1) threw exception SyntaxError: Not enough arguments.
    807 PASS view.setFloat64(1) threw exception SyntaxError: Not enough arguments.
     802PASS view.setInt16(1) threw exception TypeError: Not enough arguments.
     803PASS view.setUint16(1) threw exception TypeError: Not enough arguments.
     804PASS view.setInt32(1) threw exception TypeError: Not enough arguments.
     805PASS view.setUint32(1) threw exception TypeError: Not enough arguments.
     806PASS view.setFloat32(1) threw exception TypeError: Not enough arguments.
     807PASS view.setFloat64(1) threw exception TypeError: Not enough arguments.
    808808
    809809Test for indexing that should not work
  • trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt

    r33990 r89315  
    55PASS: req.send(null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    66open()
    7 PASS: req.setRequestHeader() threw exception SyntaxError: Not enough arguments.
    8 PASS: req.setRequestHeader("Foo") threw exception SyntaxError: Not enough arguments.
     7PASS: req.setRequestHeader() threw exception TypeError: Not enough arguments.
     8PASS: req.setRequestHeader("Foo") threw exception TypeError: Not enough arguments.
    99PASS: req.status() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    1010PASS: req.statusText() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
     
    1212PASS: req.send(null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    1313PASS: req.setRequestHeader("Foo", "bar") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
    14 PASS: req.getResponseHeader() threw exception SyntaxError: Not enough arguments.
     14PASS: req.getResponseHeader() threw exception TypeError: Not enough arguments.
  • trunk/LayoutTests/platform/chromium-mac/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt

    r77135 r89315  
    44
    55
    6 PASS path.pathSegList.initialize(); threw exception SyntaxError: Not enough arguments.
     6PASS path.pathSegList.initialize(); threw exception TypeError: Not enough arguments.
    77PASS path.getPathSegAtLength(0) is 0
    88PASS path.insertItemBefore(null, 0) threw exception TypeError: Object #<SVGPathElement> has no method 'insertItemBefore'.
  • trunk/LayoutTests/platform/chromium-win/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt

    r77135 r89315  
    44
    55
    6 PASS path.pathSegList.initialize(); threw exception SyntaxError: Not enough arguments.
     6PASS path.pathSegList.initialize(); threw exception TypeError: Not enough arguments.
    77PASS path.getPathSegAtLength(0) is 0
    88PASS path.insertItemBefore(null, 0) threw exception TypeError: Object #<SVGPathElement> has no method 'insertItemBefore'.
  • trunk/LayoutTests/svg/dom/SVGAngle-expected.txt

    r72123 r89315  
    1818PASS angle.convertToSpecifiedUnits(angle) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    1919PASS angle.convertToSpecifiedUnits(svgElement) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    20 PASS angle.convertToSpecifiedUnits() threw exception SyntaxError: Not enough arguments.
     20PASS angle.convertToSpecifiedUnits() threw exception TypeError: Not enough arguments.
    2121PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED
    2222
     
    4747PASS angle.newValueSpecifiedUnits(-1, 50) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    4848PASS angle.newValueSpecifiedUnits(5, 50) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    49 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception SyntaxError: Not enough arguments.
     49PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception TypeError: Not enough arguments.
    5050PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 'aString') is undefined.
    5151PASS angle.value is NaN
     
    5555PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, svgElement) is undefined.
    5656PASS angle.value is NaN
    57 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception SyntaxError: Not enough arguments.
     57PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception TypeError: Not enough arguments.
    5858PASS angle.newValueSpecifiedUnits('aString', 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    5959PASS angle.newValueSpecifiedUnits(angle, 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
     
    6262PASS angle.newValueSpecifiedUnits(angle, angle) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    6363PASS angle.newValueSpecifiedUnits(svgElement, svgElement) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    64 PASS angle.newValueSpecifiedUnits() threw exception SyntaxError: Not enough arguments.
     64PASS angle.newValueSpecifiedUnits() threw exception TypeError: Not enough arguments.
    6565PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG
    6666
  • trunk/LayoutTests/svg/dom/SVGColor-expected.txt

    r79985 r89315  
    2020PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_RGBCOLOR, '', '') threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
    2121PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_CURRENTCOLOR + 1, '', ''); threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
    22 PASS stopColor.setColor() threw exception SyntaxError: Not enough arguments.
    23 PASS stopColor.setColor(stopColor) threw exception SyntaxError: Not enough arguments.
     22PASS stopColor.setColor() threw exception TypeError: Not enough arguments.
     23PASS stopColor.setColor(stopColor) threw exception TypeError: Not enough arguments.
    2424
    2525Try assigning to the readonly colorType property, which silently fails
  • trunk/LayoutTests/svg/dom/SVGLength-expected.txt

    r72123 r89315  
    4242PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, svgElement) is undefined.
    4343PASS length.value is NaN
    44 PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX) threw exception SyntaxError: Not enough arguments.
     44PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX) threw exception TypeError: Not enough arguments.
    4545PASS length.newValueSpecifiedUnits('aString', 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    4646PASS length.newValueSpecifiedUnits(length, 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
  • trunk/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt

    r72518 r89315  
    2525
    2626Test uncommon arguments for insertItemBefore()
    27 PASS text1.x.baseVal.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
    28 PASS text1.x.baseVal.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
    29 PASS text1.x.baseVal.insertItemBefore(text1) threw exception SyntaxError: Not enough arguments.
    30 PASS text1.x.baseVal.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
     27PASS text1.x.baseVal.insertItemBefore(30) threw exception TypeError: Not enough arguments.
     28PASS text1.x.baseVal.insertItemBefore('aString') threw exception TypeError: Not enough arguments.
     29PASS text1.x.baseVal.insertItemBefore(text1) threw exception TypeError: Not enough arguments.
     30PASS text1.x.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments.
    3131PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aString') is text1.x.baseVal.getItem(0)
    3232PASS text1.x.baseVal.numberOfItems is 3
     
    6868
    6969Test uncommon arguments for replaceItem()
    70 PASS text1.x.baseVal.replaceItem(30) threw exception SyntaxError: Not enough arguments.
    71 PASS text1.x.baseVal.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
    72 PASS text1.x.baseVal.replaceItem(text1) threw exception SyntaxError: Not enough arguments.
    73 PASS text1.x.baseVal.replaceItem(null) threw exception SyntaxError: Not enough arguments.
     70PASS text1.x.baseVal.replaceItem(30) threw exception TypeError: Not enough arguments.
     71PASS text1.x.baseVal.replaceItem('aString') threw exception TypeError: Not enough arguments.
     72PASS text1.x.baseVal.replaceItem(text1) threw exception TypeError: Not enough arguments.
     73PASS text1.x.baseVal.replaceItem(null) threw exception TypeError: Not enough arguments.
    7474PASS text1.x.baseVal.replaceItem(30, 0) threw exception TypeError: Type error.
    7575PASS text1.x.baseVal.replaceItem('aString', 0) threw exception TypeError: Type error.
  • trunk/LayoutTests/svg/dom/SVGMatrix-expected.txt

    r72123 r89315  
    9191
    9292Check calling 'multiply' with invalid arguments
    93 PASS matrix.multiply() threw exception SyntaxError: Not enough arguments.
     93PASS matrix.multiply() threw exception TypeError: Not enough arguments.
    9494PASS matrix.multiply(true) threw exception TypeError: Type error.
    9595PASS matrix.multiply(2) threw exception TypeError: Type error.
     
    9898
    9999Check calling 'translate' with invalid arguments
    100 PASS matrix.translate() threw exception SyntaxError: Not enough arguments.
    101 PASS matrix.translate(true) threw exception SyntaxError: Not enough arguments.
    102 PASS matrix.translate(2) threw exception SyntaxError: Not enough arguments.
    103 PASS matrix.translate('aString') threw exception SyntaxError: Not enough arguments.
    104 PASS matrix.translate(svgElement) threw exception SyntaxError: Not enough arguments.
     100PASS matrix.translate() threw exception TypeError: Not enough arguments.
     101PASS matrix.translate(true) threw exception TypeError: Not enough arguments.
     102PASS matrix.translate(2) threw exception TypeError: Not enough arguments.
     103PASS matrix.translate('aString') threw exception TypeError: Not enough arguments.
     104PASS matrix.translate(svgElement) threw exception TypeError: Not enough arguments.
    105105PASS matrix.translate('aString', 'aString') is non-null.
    106106PASS matrix.translate(svgElement, svgElement) is non-null.
     
    111111
    112112Check calling 'scale' with invalid arguments
    113 PASS matrix.scale() threw exception SyntaxError: Not enough arguments.
     113PASS matrix.scale() threw exception TypeError: Not enough arguments.
    114114PASS matrix.scale('aString') is non-null.
    115115PASS matrix.scale(svgElement) is non-null.
    116116
    117117Check calling 'scaleNonUniform' with invalid arguments
    118 PASS matrix.scaleNonUniform() threw exception SyntaxError: Not enough arguments.
    119 PASS matrix.scaleNonUniform(true) threw exception SyntaxError: Not enough arguments.
    120 PASS matrix.scaleNonUniform(2) threw exception SyntaxError: Not enough arguments.
    121 PASS matrix.scaleNonUniform('aString') threw exception SyntaxError: Not enough arguments.
    122 PASS matrix.scaleNonUniform(svgElement) threw exception SyntaxError: Not enough arguments.
     118PASS matrix.scaleNonUniform() threw exception TypeError: Not enough arguments.
     119PASS matrix.scaleNonUniform(true) threw exception TypeError: Not enough arguments.
     120PASS matrix.scaleNonUniform(2) threw exception TypeError: Not enough arguments.
     121PASS matrix.scaleNonUniform('aString') threw exception TypeError: Not enough arguments.
     122PASS matrix.scaleNonUniform(svgElement) threw exception TypeError: Not enough arguments.
    123123PASS matrix.scaleNonUniform('aString', 'aString') is non-null.
    124124PASS matrix.scaleNonUniform(svgElement, svgElement) is non-null.
     
    129129
    130130Check calling 'rotate' with invalid arguments
    131 PASS matrix.rotate() threw exception SyntaxError: Not enough arguments.
     131PASS matrix.rotate() threw exception TypeError: Not enough arguments.
    132132PASS matrix.rotate('aString') is non-null.
    133133PASS matrix.rotate(svgElement) is non-null.
    134134
    135135Check calling 'rotateFromVector' with invalid arguments
    136 PASS matrix.rotateFromVector() threw exception SyntaxError: Not enough arguments.
    137 PASS matrix.rotateFromVector(true) threw exception SyntaxError: Not enough arguments.
    138 PASS matrix.rotateFromVector(2) threw exception SyntaxError: Not enough arguments.
    139 PASS matrix.rotateFromVector('aString') threw exception SyntaxError: Not enough arguments.
    140 PASS matrix.rotateFromVector(svgElement) threw exception SyntaxError: Not enough arguments.
     136PASS matrix.rotateFromVector() threw exception TypeError: Not enough arguments.
     137PASS matrix.rotateFromVector(true) threw exception TypeError: Not enough arguments.
     138PASS matrix.rotateFromVector(2) threw exception TypeError: Not enough arguments.
     139PASS matrix.rotateFromVector('aString') threw exception TypeError: Not enough arguments.
     140PASS matrix.rotateFromVector(svgElement) threw exception TypeError: Not enough arguments.
    141141PASS matrix.rotateFromVector('aString', 'aString') is non-null.
    142142PASS matrix.rotateFromVector(svgElement, svgElement) is non-null.
     
    147147
    148148Check calling 'skewX' with invalid arguments
    149 PASS matrix.skewX() threw exception SyntaxError: Not enough arguments.
     149PASS matrix.skewX() threw exception TypeError: Not enough arguments.
    150150PASS matrix.skewX('aString') is non-null.
    151151PASS matrix.skewX(svgElement) is non-null.
    152152
    153153Check calling 'skewY' with invalid arguments
    154 PASS matrix.skewY() threw exception SyntaxError: Not enough arguments.
     154PASS matrix.skewY() threw exception TypeError: Not enough arguments.
    155155PASS matrix.skewY('aString') is non-null.
    156156PASS matrix.skewY(svgElement) is non-null.
  • trunk/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt

    r72518 r89315  
    2222
    2323Test uncommon arguments for insertItemBefore()
    24 PASS text1.rotate.baseVal.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
    25 PASS text1.rotate.baseVal.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
    26 PASS text1.rotate.baseVal.insertItemBefore(text1) threw exception SyntaxError: Not enough arguments.
    27 PASS text1.rotate.baseVal.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
     24PASS text1.rotate.baseVal.insertItemBefore(30) threw exception TypeError: Not enough arguments.
     25PASS text1.rotate.baseVal.insertItemBefore('aString') threw exception TypeError: Not enough arguments.
     26PASS text1.rotate.baseVal.insertItemBefore(text1) threw exception TypeError: Not enough arguments.
     27PASS text1.rotate.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments.
    2828PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 'aString') is text1.rotate.baseVal.getItem(0)
    2929PASS text1.rotate.baseVal.numberOfItems is 3
     
    6565
    6666Test uncommon arguments for replaceItem()
    67 PASS text1.rotate.baseVal.replaceItem(30) threw exception SyntaxError: Not enough arguments.
    68 PASS text1.rotate.baseVal.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
    69 PASS text1.rotate.baseVal.replaceItem(text1) threw exception SyntaxError: Not enough arguments.
    70 PASS text1.rotate.baseVal.replaceItem(null) threw exception SyntaxError: Not enough arguments.
     67PASS text1.rotate.baseVal.replaceItem(30) threw exception TypeError: Not enough arguments.
     68PASS text1.rotate.baseVal.replaceItem('aString') threw exception TypeError: Not enough arguments.
     69PASS text1.rotate.baseVal.replaceItem(text1) threw exception TypeError: Not enough arguments.
     70PASS text1.rotate.baseVal.replaceItem(null) threw exception TypeError: Not enough arguments.
    7171PASS text1.rotate.baseVal.replaceItem(30, 0) threw exception TypeError: Type error.
    7272PASS text1.rotate.baseVal.replaceItem('aString', 0) threw exception TypeError: Type error.
  • trunk/LayoutTests/svg/dom/SVGPaint-expected.txt

    r79985 r89315  
    2020PASS fillPaint.setPaint(null, null, null, null) threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
    2121PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, svgElement, '', ''); threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
    22 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, '', '') threw exception SyntaxError: Not enough arguments.
     22PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, '', '') threw exception TypeError: Not enough arguments.
    2323PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR + 1, '', '', ''); threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
    2424PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE - 1, '', '', ''); threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
    2525PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI + 1, '', '', ''); threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
    26 PASS fillPaint.setPaint() threw exception SyntaxError: Not enough arguments.
    27 PASS fillPaint.setPaint(fillPaint) threw exception SyntaxError: Not enough arguments.
     26PASS fillPaint.setPaint() threw exception TypeError: Not enough arguments.
     27PASS fillPaint.setPaint(fillPaint) threw exception TypeError: Not enough arguments.
    2828
    2929Try invalid arguments for setUri()
    30 PASS fillPaint.setUri() threw exception SyntaxError: Not enough arguments.
     30PASS fillPaint.setUri() threw exception TypeError: Not enough arguments.
    3131
    3232Try assigning to the readonly paintType property, which silently fails
  • trunk/LayoutTests/svg/dom/SVGPoint-expected.txt

    r72123 r89315  
    2929
    3030Check invalid arguments for 'matrixTransform'
    31 PASS point.matrixTransform() threw exception SyntaxError: Not enough arguments.
     31PASS point.matrixTransform() threw exception TypeError: Not enough arguments.
    3232PASS point.matrixTransform(-1) threw exception TypeError: Type error.
    3333PASS point.matrixTransform(5) threw exception TypeError: Type error.
  • trunk/LayoutTests/svg/dom/SVGPointList-basics-expected.txt

    r72518 r89315  
    4141
    4242Test uncommon arguments for insertItemBefore()
    43 PASS poly1.points.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
    44 PASS poly1.points.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
    45 PASS poly1.points.insertItemBefore(poly1) threw exception SyntaxError: Not enough arguments.
    46 PASS poly1.points.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
     43PASS poly1.points.insertItemBefore(30) threw exception TypeError: Not enough arguments.
     44PASS poly1.points.insertItemBefore('aString') threw exception TypeError: Not enough arguments.
     45PASS poly1.points.insertItemBefore(poly1) threw exception TypeError: Not enough arguments.
     46PASS poly1.points.insertItemBefore(null) threw exception TypeError: Not enough arguments.
    4747PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString')) is "x=100 y=0"
    4848PASS poly1.points.numberOfItems is 4
     
    7878
    7979Test uncommon arguments for replaceItem()
    80 PASS poly1.points.replaceItem(30) threw exception SyntaxError: Not enough arguments.
    81 PASS poly1.points.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
    82 PASS poly1.points.replaceItem(poly1) threw exception SyntaxError: Not enough arguments.
     80PASS poly1.points.replaceItem(30) threw exception TypeError: Not enough arguments.
     81PASS poly1.points.replaceItem('aString') threw exception TypeError: Not enough arguments.
     82PASS poly1.points.replaceItem(poly1) threw exception TypeError: Not enough arguments.
    8383PASS poly1.points.replaceItem(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
    8484PASS poly1.points.replaceItem('aString', 0) threw exception TypeError: Type error.
  • trunk/LayoutTests/svg/dom/SVGStringList-basics-expected.txt

    r72518 r89315  
    3232
    3333Test uncommon arguments for insertItemBefore()
    34 PASS text1.requiredFeatures.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
    35 PASS text1.requiredFeatures.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
    36 PASS text1.requiredFeatures.insertItemBefore(text1) threw exception SyntaxError: Not enough arguments.
    37 PASS text1.requiredFeatures.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
     34PASS text1.requiredFeatures.insertItemBefore(30) threw exception TypeError: Not enough arguments.
     35PASS text1.requiredFeatures.insertItemBefore('aString') threw exception TypeError: Not enough arguments.
     36PASS text1.requiredFeatures.insertItemBefore(text1) threw exception TypeError: Not enough arguments.
     37PASS text1.requiredFeatures.insertItemBefore(null) threw exception TypeError: Not enough arguments.
    3838PASS text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), 'aString') threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
    3939PASS text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), text1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
     
    7777
    7878Test uncommon arguments for replaceItem() - part 1
    79 PASS text1.requiredFeatures.replaceItem(30) threw exception SyntaxError: Not enough arguments.
    80 PASS text1.requiredFeatures.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
    81 PASS text1.requiredFeatures.replaceItem(text1) threw exception SyntaxError: Not enough arguments.
     79PASS text1.requiredFeatures.replaceItem(30) threw exception TypeError: Not enough arguments.
     80PASS text1.requiredFeatures.replaceItem('aString') threw exception TypeError: Not enough arguments.
     81PASS text1.requiredFeatures.replaceItem(text1) threw exception TypeError: Not enough arguments.
    8282PASS text1.requiredFeatures.replaceItem(null, 0) is "null"
    8383PASS text1.requiredFeatures.numberOfItems is 4
  • trunk/LayoutTests/svg/dom/SVGTransform-expected.txt

    r72123 r89315  
    5050
    5151Check passing invalid arguments to 'setMatrix'
    52 PASS transform.setMatrix() threw exception SyntaxError: Not enough arguments.
     52PASS transform.setMatrix() threw exception TypeError: Not enough arguments.
    5353PASS transform.setMatrix(transform) threw exception TypeError: Type error.
    5454PASS transform.setMatrix(svgElement) threw exception TypeError: Type error.
     
    5858
    5959Check passing invalid arguments to 'setTranslate'
    60 PASS transform.setTranslate() threw exception SyntaxError: Not enough arguments.
    61 PASS transform.setTranslate(transform) threw exception SyntaxError: Not enough arguments.
    62 PASS transform.setTranslate(svgElement) threw exception SyntaxError: Not enough arguments.
    63 PASS transform.setTranslate('aString') threw exception SyntaxError: Not enough arguments.
     60PASS transform.setTranslate() threw exception TypeError: Not enough arguments.
     61PASS transform.setTranslate(transform) threw exception TypeError: Not enough arguments.
     62PASS transform.setTranslate(svgElement) threw exception TypeError: Not enough arguments.
     63PASS transform.setTranslate('aString') threw exception TypeError: Not enough arguments.
    6464PASS transform.setTranslate(1, transform) is undefined.
    6565PASS transform.setTranslate(1, svgElement) is undefined.
     
    7373
    7474Check passing invalid arguments to 'setScale'
    75 PASS transform.setScale() threw exception SyntaxError: Not enough arguments.
    76 PASS transform.setScale(transform) threw exception SyntaxError: Not enough arguments.
    77 PASS transform.setScale(svgElement) threw exception SyntaxError: Not enough arguments.
    78 PASS transform.setScale('aString') threw exception SyntaxError: Not enough arguments.
     75PASS transform.setScale() threw exception TypeError: Not enough arguments.
     76PASS transform.setScale(transform) threw exception TypeError: Not enough arguments.
     77PASS transform.setScale(svgElement) threw exception TypeError: Not enough arguments.
     78PASS transform.setScale('aString') threw exception TypeError: Not enough arguments.
    7979PASS transform.setScale(1, transform) is undefined.
    8080PASS transform.setScale(1, svgElement) is undefined.
     
    8888
    8989Check passing invalid arguments to 'setRotate'
    90 PASS transform.setRotate() threw exception SyntaxError: Not enough arguments.
    91 PASS transform.setRotate(transform) threw exception SyntaxError: Not enough arguments.
    92 PASS transform.setRotate(svgElement) threw exception SyntaxError: Not enough arguments.
    93 PASS transform.setRotate('aString') threw exception SyntaxError: Not enough arguments.
    94 PASS transform.setRotate(1, transform) threw exception SyntaxError: Not enough arguments.
    95 PASS transform.setRotate(1, svgElement) threw exception SyntaxError: Not enough arguments.
    96 PASS transform.setRotate(1, 'aString') threw exception SyntaxError: Not enough arguments.
     90PASS transform.setRotate() threw exception TypeError: Not enough arguments.
     91PASS transform.setRotate(transform) threw exception TypeError: Not enough arguments.
     92PASS transform.setRotate(svgElement) threw exception TypeError: Not enough arguments.
     93PASS transform.setRotate('aString') threw exception TypeError: Not enough arguments.
     94PASS transform.setRotate(1, transform) threw exception TypeError: Not enough arguments.
     95PASS transform.setRotate(1, svgElement) threw exception TypeError: Not enough arguments.
     96PASS transform.setRotate(1, 'aString') threw exception TypeError: Not enough arguments.
    9797PASS transform.setRotate(1, 1, transform) is undefined.
    9898PASS transform.setRotate(1, 1, svgElement) is undefined.
     
    100100
    101101Check passing invalid arguments to 'setSkewX'
    102 PASS transform.setSkewX() threw exception SyntaxError: Not enough arguments.
     102PASS transform.setSkewX() threw exception TypeError: Not enough arguments.
    103103PASS transform.setSkewX(transform) is undefined.
    104104PASS transform.setSkewX(svgElement) is undefined.
     
    106106
    107107Check passing invalid arguments to 'setSkewY'
    108 PASS transform.setSkewY() threw exception SyntaxError: Not enough arguments.
     108PASS transform.setSkewY() threw exception TypeError: Not enough arguments.
    109109PASS transform.setSkewY(transform) is undefined.
    110110PASS transform.setSkewY(svgElement) is undefined.
  • trunk/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt

    r72518 r89315  
    2323
    2424Test uncommon arguments for insertItemBefore()
    25 PASS circle1.transform.baseVal.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
    26 PASS circle1.transform.baseVal.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
    27 PASS circle1.transform.baseVal.insertItemBefore(circle1) threw exception SyntaxError: Not enough arguments.
    28 PASS circle1.transform.baseVal.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
     25PASS circle1.transform.baseVal.insertItemBefore(30) threw exception TypeError: Not enough arguments.
     26PASS circle1.transform.baseVal.insertItemBefore('aString') threw exception TypeError: Not enough arguments.
     27PASS circle1.transform.baseVal.insertItemBefore(circle1) threw exception TypeError: Not enough arguments.
     28PASS circle1.transform.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments.
    2929PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString') is circle1.transform.baseVal.getItem(0)
    3030PASS circle1.transform.baseVal.numberOfItems is 2
     
    6262
    6363Test uncommon arguments for replaceItem()
    64 PASS circle1.transform.baseVal.replaceItem(30) threw exception SyntaxError: Not enough arguments.
    65 PASS circle1.transform.baseVal.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
    66 PASS circle1.transform.baseVal.replaceItem(circle1) threw exception SyntaxError: Not enough arguments.
    67 PASS circle1.transform.baseVal.replaceItem(null) threw exception SyntaxError: Not enough arguments.
     64PASS circle1.transform.baseVal.replaceItem(30) threw exception TypeError: Not enough arguments.
     65PASS circle1.transform.baseVal.replaceItem('aString') threw exception TypeError: Not enough arguments.
     66PASS circle1.transform.baseVal.replaceItem(circle1) threw exception TypeError: Not enough arguments.
     67PASS circle1.transform.baseVal.replaceItem(null) threw exception TypeError: Not enough arguments.
    6868PASS circle1.transform.baseVal.replaceItem(30, 0) threw exception TypeError: Type error.
    6969PASS circle1.transform.baseVal.replaceItem('aString', 0) threw exception TypeError: Type error.
  • trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt

    r73345 r89315  
    66
    77Check passing invalid arguments to 'createSVGTransformFromMatrix'
    8 PASS transform.createSVGTransformFromMatrix() threw exception SyntaxError: Not enough arguments.
     8PASS transform.createSVGTransformFromMatrix() threw exception TypeError: Not enough arguments.
    99PASS transform.createSVGTransformFromMatrix(svgElement.createSVGTransform()) threw exception TypeError: Type error.
    1010PASS transform.createSVGTransformFromMatrix(svgElement) threw exception TypeError: Type error.
  • trunk/LayoutTests/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt

    r72381 r89315  
    44
    55
    6 PASS path.pathSegList.initialize(); threw exception SyntaxError: Not enough arguments.
     6PASS path.pathSegList.initialize(); threw exception TypeError: Not enough arguments.
    77PASS path.getPathSegAtLength(0) is 0
    88PASS path.insertItemBefore(null, 0) threw exception TypeError: 'undefined' is not a function (evaluating 'path.insertItemBefore(null, 0)').
  • trunk/Source/WebCore/ChangeLog

    r89314 r89315  
     12011-06-20  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        IDL generator should throw TypeError instead of SyntaxError on not enough arguments
     6        https://bugs.webkit.org/show_bug.cgi?id=63011
     7
     8        To align with WebIDL, we should throw TypeError whenever a function
     9        is called with missing required arguments.
     10
     11        * bindings/scripts/CodeGeneratorJS.pm:
     12        * bindings/scripts/CodeGeneratorV8.pm:
     13        * bindings/scripts/test/V8/V8TestObj.cpp:
     14        (WebCore::TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback):
     15
    1162011-05-03  Martin Robinson  <mrobinson@igalia.com>
    217
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r89269 r89315  
    19491949                        push(@implContent, "    if (exec->argumentCount() < $numMandatoryParams)\n");
    19501950                        if ($requiresAllArguments eq "Raise") {
    1951                             push(@implContent, "        return throwVMError(exec, createSyntaxError(exec, \"Not enough arguments\"));\n");
     1951                            push(@implContent, "        return throwVMError(exec, createTypeError(exec, \"Not enough arguments\"));\n");
    19521952                        } else {
    19531953                            push(@implContent, "        return JSValue::encode(jsUndefined());\n");
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r89261 r89315  
    12601260        push(@implContentDecls, "    if (args.Length() < $numMandatoryParams)\n");
    12611261        if ($requiresAllArguments eq "Raise") {
    1262             push(@implContentDecls, "        return throwError(\"Not enough arguments\", V8Proxy::SyntaxError);\n");
     1262            push(@implContentDecls, "        return throwError(\"Not enough arguments\", V8Proxy::TypeError);\n");
    12631263        } else {
    12641264            push(@implContentDecls, "        return v8::Handle<v8::Value>();\n");
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r89267 r89315  
    10371037    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    10381038    if (exec->argumentCount() < 2)
    1039         return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
     1039        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
    10401040    ExceptionCode ec = 0;
    10411041    const String& strArg(ustringToString(exec->argument(0).toString(exec)));
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r89267 r89315  
    699699    INC_STATS("DOM.TestObj.methodThatRequiresAllArgsAndThrows");
    700700    if (args.Length() < 2)
    701         return throwError("Not enough arguments", V8Proxy::SyntaxError);
     701        return throwError("Not enough arguments", V8Proxy::TypeError);
    702702    TestObj* imp = V8TestObj::toNative(args.Holder());
    703703    ExceptionCode ec = 0;
Note: See TracChangeset for help on using the changeset viewer.