Changeset 204028 in webkit
- Timestamp:
- Aug 2, 2016 10:02:23 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r204024 r204028 1 2016-08-02 Chris Dumez <cdumez@apple.com> 2 3 [WebIDL] Implement overload resolution algorithm 4 https://bugs.webkit.org/show_bug.cgi?id=160394 5 6 Reviewed by Darin Adler. 7 8 Update / Rebaseline existing test. There is no major behavior change. 9 We sometimes get a different exception message than we used to. 10 11 * fast/canvas/canvas-clip-path-expected.txt: 12 * fast/canvas/canvas-fill-path-expected.txt: 13 * fast/canvas/canvas-path-addPath-expected.txt: 14 * fast/canvas/canvas-path-isPointInPath-expected.txt: 15 * fast/canvas/canvas-path-isPointInStroke-expected.txt: 16 * fast/canvas/canvas-putImageData-expected.txt: 17 * fast/canvas/canvas-putImageData.js: 18 * fast/canvas/canvas-stroke-path-expected.txt: 19 * fast/canvas/webgl/script-tests/texImageTest.js: 20 * fast/canvas/webgl/texImageTest-expected.txt: 21 * fast/dom/HTMLSelectElement/add-expected.txt: 22 * fast/dom/HTMLSelectElement/add.html: 23 * fast/dom/HTMLSelectElement/options-collection-add-expected.txt: 24 * fast/dom/HTMLSelectElement/options-collection-add.html: 25 * fast/dom/incompatible-operations-expected.txt: 26 * js/dom/select-options-add-expected.txt: 27 * webaudio/audiobuffer-expected.txt: 28 * webaudio/audiobuffer.html: 29 * webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html: 30 1 31 2016-08-02 Per Arne Vollan <pvollan@apple.com> 2 32 -
trunk/LayoutTests/fast/canvas/canvas-clip-path-expected.txt
r190021 r204028 33 33 PASS ctx.clip(false) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.clip must be one of: "nonzero", "evenodd". 34 34 PASS ctx.clip(new Date()) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.clip must be one of: "nonzero", "evenodd". 35 PASS ctx.clip(0, 'nonzero') threw exception TypeError: Type error.36 PASS ctx.clip(null, 'nonzero') threw exception TypeError: Type error.37 PASS ctx.clip('path2d', 'nonzero') threw exception TypeError: Type error.38 PASS ctx.clip(undefined, 'nonzero') threw exception TypeError: Type error.39 PASS ctx.clip(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Type error.40 PASS ctx.clip(function() {}, 'nonzero') threw exception TypeError: Type error.41 PASS ctx.clip(false, 'nonzero') threw exception TypeError: Type error.42 PASS ctx.clip(new Date(), 'nonzero') threw exception TypeError: Type error.35 PASS ctx.clip(0, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 36 PASS ctx.clip(null, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 37 PASS ctx.clip('path2d', 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 38 PASS ctx.clip(undefined, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 39 PASS ctx.clip(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 40 PASS ctx.clip(function() {}, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 41 PASS ctx.clip(false, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 42 PASS ctx.clip(new Date(), 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath. 43 43 PASS successfullyParsed is true 44 44 -
trunk/LayoutTests/fast/canvas/canvas-fill-path-expected.txt
r190021 r204028 32 32 PASS ctx.fill(false) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.fill must be one of: "nonzero", "evenodd". 33 33 PASS ctx.fill(new Date()) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.fill must be one of: "nonzero", "evenodd". 34 PASS ctx.fill(0, 'nonzero') threw exception TypeError: Type error.35 PASS ctx.fill(null, 'nonzero') threw exception TypeError: Type error.36 PASS ctx.fill('path2d', 'nonzero') threw exception TypeError: Type error.34 PASS ctx.fill(0, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 35 PASS ctx.fill(null, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 36 PASS ctx.fill('path2d', 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 37 37 FAIL ctx.fill(undefined) should throw an exception. Was undefined. 38 PASS ctx.fill(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Type error.39 PASS ctx.fill(function() {}, 'nonzero') threw exception TypeError: Type error.40 PASS ctx.fill(false, 'nonzero') threw exception TypeError: Type error.41 PASS ctx.fill(new Date(), 'nonzero') threw exception TypeError: Type error.38 PASS ctx.fill(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 39 PASS ctx.fill(function() {}, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 40 PASS ctx.fill(false, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 41 PASS ctx.fill(new Date(), 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath. 42 42 PASS successfullyParsed is true 43 43 -
trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt
r199265 r204028 32 32 33 33 Various tests of invalid values. 34 PASS pathA.addPath(matrix, pathB) threw exception TypeError: Type error.35 PASS pathA.addPath(pathB, ctx.canvas) threw exception TypeError: Type error.36 PASS pathA.addPath(pathB, null) threw exception TypeError: Type error.37 PASS pathA.addPath(pathB, undefined) threw exception TypeError: Type error.38 PASS pathA.addPath(pathB, 0) threw exception TypeError: Type error.39 PASS pathA.addPath(pathB, "0") threw exception TypeError: Type error.34 PASS pathA.addPath(matrix, pathB) threw exception TypeError: Argument 1 ('path') to Path2D.addPath must be an instance of DOMPath. 35 PASS pathA.addPath(pathB, ctx.canvas) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix. 36 PASS pathA.addPath(pathB, null) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix. 37 PASS pathA.addPath(pathB, undefined) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix. 38 PASS pathA.addPath(pathB, 0) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix. 39 PASS pathA.addPath(pathB, "0") threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix. 40 40 PASS successfullyParsed is true 41 41 -
trunk/LayoutTests/fast/canvas/canvas-path-isPointInPath-expected.txt
r165927 r204028 11 11 PASS ctx.isPointInPath(path, 50, 50, 'nonzero') is false 12 12 PASS ctx.isPointInPath(null, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: "nonzero", "evenodd". 13 PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Type error.14 PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Type error.13 PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 14 PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 15 15 PASS ctx.isPointInPath([], 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: "nonzero", "evenodd". 16 PASS ctx.isPointInPath([], 50, 50, 'nonzero') threw exception TypeError: Type error.17 PASS ctx.isPointInPath([], 50, 50, 'evenodd') threw exception TypeError: Type error.16 PASS ctx.isPointInPath([], 50, 50, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 17 PASS ctx.isPointInPath([], 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 18 18 PASS ctx.isPointInPath({}, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: "nonzero", "evenodd". 19 PASS ctx.isPointInPath({}, 50, 50, 'nonzero') threw exception TypeError: Type error.20 PASS ctx.isPointInPath({}, 50, 50, 'evenodd') threw exception TypeError: Type error.21 PASS ctx.isPointInPath('path2d', 50, 50, 'evenodd') threw exception TypeError: Type error.22 PASS ctx.isPointInPath(undefined, 50, 50, 'evenodd') threw exception TypeError: Type error.23 PASS ctx.isPointInPath(Number.MAX_VALUE, 50, 50, 'evenodd') threw exception TypeError: Type error.24 PASS ctx.isPointInPath(function() {}, 50, 50, 'evenodd') threw exception TypeError: Type error.25 PASS ctx.isPointInPath(false, 50, 50, 'evenodd') threw exception TypeError: Type error.26 PASS ctx.isPointInPath(new Date(), 50, 50, 'evenodd') threw exception TypeError: Type error.19 PASS ctx.isPointInPath({}, 50, 50, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 20 PASS ctx.isPointInPath({}, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 21 PASS ctx.isPointInPath('path2d', 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 22 PASS ctx.isPointInPath(undefined, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 23 PASS ctx.isPointInPath(Number.MAX_VALUE, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 24 PASS ctx.isPointInPath(function() {}, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 25 PASS ctx.isPointInPath(false, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 26 PASS ctx.isPointInPath(new Date(), 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath. 27 27 PASS successfullyParsed is true 28 28 -
trunk/LayoutTests/fast/canvas/canvas-path-isPointInStroke-expected.txt
r165927 r204028 22 22 PASS ctx.isPointInStroke(path,NaN,122) is false 23 23 PASS ctx.isPointInStroke(path,18,NaN) is false 24 PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Type error.25 PASS ctx.isPointInStroke([],20,70) threw exception TypeError: Type error.26 PASS ctx.isPointInStroke({},120,70) threw exception TypeError: Type error.24 PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInStroke must be an instance of DOMPath. 25 PASS ctx.isPointInStroke([],20,70) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInStroke must be an instance of DOMPath. 26 PASS ctx.isPointInStroke({},120,70) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInStroke must be an instance of DOMPath. 27 27 PASS ctx.isPointInPath('path2d', 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: "nonzero", "evenodd". 28 28 PASS ctx.isPointInPath(undefined, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: "nonzero", "evenodd". -
trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt
r200528 r204028 145 145 PASS getPixel(1,1) is [0,128,0,255] 146 146 PASS getPixel(9,9) is [0,128,0,255] 147 PASS context.putImageData({}, 0, 0) threw exception TypeError: Type error.147 PASS context.putImageData({}, 0, 0) threw exception TypeError: Argument 1 ('imagedata') to CanvasRenderingContext2D.putImageData must be an instance of ImageData. 148 148 PASS context.putImageData(buffer, NaN, 0, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite. 149 149 PASS context.putImageData(buffer, 0, NaN, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite. -
trunk/LayoutTests/fast/canvas/canvas-putImageData.js
r200528 r204028 202 202 203 203 204 shouldThrow ("context.putImageData({}, 0, 0)", "'TypeError: Type error'");204 shouldThrowErrorName("context.putImageData({}, 0, 0)", "TypeError"); 205 205 shouldThrow("context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'"); 206 206 shouldThrow("context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'"); -
trunk/LayoutTests/fast/canvas/canvas-stroke-path-expected.txt
r165976 r204028 18 18 PASS areaColor(imageData.data, {r:0,g:255,b:0,a:255}) is true 19 19 20 PASS ctx.stroke(0) threw exception TypeError: Type error.21 PASS ctx.stroke(null) threw exception TypeError: Type error.22 PASS ctx.stroke('path2d') threw exception TypeError: Type error.23 PASS ctx.stroke(undefined) threw exception TypeError: Type error.24 PASS ctx.stroke(Number.MAX_VALUE) threw exception TypeError: Type error.25 PASS ctx.stroke(function() {}) threw exception TypeError: Type error.26 PASS ctx.stroke(false) threw exception TypeError: Type error.27 PASS ctx.stroke(new Date()) threw exception TypeError: Type error.20 PASS ctx.stroke(0) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 21 PASS ctx.stroke(null) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 22 PASS ctx.stroke('path2d') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 23 PASS ctx.stroke(undefined) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 24 PASS ctx.stroke(Number.MAX_VALUE) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 25 PASS ctx.stroke(function() {}) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 26 PASS ctx.stroke(false) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 27 PASS ctx.stroke(new Date()) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath. 28 28 PASS successfullyParsed is true 29 29 -
trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js
r140851 r204028 26 26 shouldThrow("context.texSubImage2D(context.TEXTURE_2D)"); 27 27 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null)"); 28 should Throw("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)");28 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)"); // We do not do strict type checking on ArrayBufferView. 29 29 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0)"); 30 30 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); -
trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt
r126562 r204028 16 16 PASS context.texSubImage2D(context.TEXTURE_2D) threw exception TypeError: Not enough arguments. 17 17 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined. 18 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.18 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) is undefined. 19 19 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error. 20 20 PASS context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false) is undefined. -
trunk/LayoutTests/fast/dom/HTMLSelectElement/add-expected.txt
r186275 r204028 10 10 Call HTMLSelectElement.add() with one argument: 11 11 PASS testAdd(createOption("Y1")) is "0,1,2,Y1" 12 PASS testAdd("foo") threw exception TypeError: Type error.13 PASS testAdd(undefined) threw exception TypeError: Type error.14 PASS testAdd(null) threw exception TypeError: Type error.12 PASS testAdd("foo") threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 13 PASS testAdd(undefined) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 14 PASS testAdd(null) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 15 15 16 16 Call HTMLSelectElement.add() with two arguments: … … 41 41 PASS testAdd(createOption("X"), mySelect.options[1]) is "0,X,1,2" 42 42 PASS testAdd(createOption("X"), mySelect.options[2]) is "0,1,X,2" 43 PASS testAdd("foo", 0) threw exception TypeError: Type error.44 PASS testAdd(undefined, 0) threw exception TypeError: Type error.45 PASS testAdd(null, 0) threw exception TypeError: Type error.43 PASS testAdd("foo", 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 44 PASS testAdd(undefined, 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 45 PASS testAdd(null, 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 46 46 47 47 Call HTMLSelectElement.add() with three arguments (when it only takes two arguments): -
trunk/LayoutTests/fast/dom/HTMLSelectElement/add.html
r186275 r204028 2 2 <html> 3 3 <head> 4 <script src="../../../resources/js-test .js"></script>4 <script src="../../../resources/js-test-pre.js"></script> 5 5 <script src="resources/html-select-and-options-collection-utilities.js"></script> 6 6 </head> … … 24 24 debug("<br>Call HTMLSelectElement.add() with one argument:"); 25 25 shouldBeEqualToString('testAdd(createOption("Y1"))', "0,1,2,Y1"); 26 shouldThrow ('testAdd("foo")');27 shouldThrow ("testAdd(undefined)");28 shouldThrow ("testAdd(null)");26 shouldThrowErrorName('testAdd("foo")', "TypeError"); 27 shouldThrowErrorName("testAdd(undefined)", "TypeError"); 28 shouldThrowErrorName("testAdd(null)", "TypeError"); 29 29 30 30 debug("<br>Call HTMLSelectElement.add() with two arguments:"); … … 55 55 shouldBeEqualToString('testAdd(createOption("X"), mySelect.options[1])', "0,X,1,2"); 56 56 shouldBeEqualToString('testAdd(createOption("X"), mySelect.options[2])', "0,1,X,2"); 57 shouldThrow ('testAdd("foo", 0)', "'TypeError: Type error'");58 shouldThrow ('testAdd(undefined, 0)', "'TypeError: Type error'");59 shouldThrow ('testAdd(null, 0)', "'TypeError: Type error'");57 shouldThrowErrorName('testAdd("foo", 0)', "TypeError"); 58 shouldThrowErrorName('testAdd(undefined, 0)', "TypeError"); 59 shouldThrowErrorName('testAdd(null, 0)', "TypeError"); 60 60 61 61 debug("<br>Call HTMLSelectElement.add() with three arguments (when it only takes two arguments):"); … … 63 63 shouldBeEqualToString('testAdd(createOption("X"), mySelect.options[1], "unnecessary extra argument - should be ignored")', "0,X,1,2"); 64 64 </script> 65 <script src="../../../resources/js-test-post.js"></script> 65 66 </body> 66 67 </html> -
trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add-expected.txt
r203333 r204028 10 10 Call HTMLOptionsCollection.add() with only one argument: 11 11 PASS testAdd(createOption("Y9")) is "0,1,2,Y9" 12 PASS testAdd("foo") threw exception TypeError: Type error.13 PASS testAdd(undefined) threw exception TypeError: Type error.14 PASS testAdd(null) threw exception TypeError: Type error.12 PASS testAdd("foo") threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 13 PASS testAdd(undefined) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 14 PASS testAdd(null) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 15 15 16 16 Call HTMLOptionsCollection.add() with two arguments: … … 53 53 PASS testAdd(createOption("Y25"), 0, 1) is "Y25,0,1,2" 54 54 PASS testAdd(createOption("Y25"), mySelect.options[0], 1) is "Y25,0,1,2" 55 PASS testAdd("foo", 0) threw exception TypeError: Type error.56 PASS testAdd(undefined, 0) threw exception TypeError: Type error.57 PASS testAdd(null, 0) threw exception TypeError: Type error.55 PASS testAdd("foo", 0) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 56 PASS testAdd(undefined, 0) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 57 PASS testAdd(null, 0) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 58 58 59 59 Call HTMLOptionsCollection.add() with three arguments (when it only takes two arguments): -
trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add.html
r186275 r204028 2 2 <html> 3 3 <head> 4 <script src="../../../resources/js-test .js"></script>4 <script src="../../../resources/js-test-pre.js"></script> 5 5 <script src="resources/html-select-and-options-collection-utilities.js"></script> 6 6 </head> … … 30 30 debug("<br>Call HTMLOptionsCollection.add() with only one argument:"); 31 31 shouldBeEqualToString('testAdd(createOption("Y9"))', "0,1,2,Y9"); 32 shouldThrow ('testAdd("foo")');33 shouldThrow ("testAdd(undefined)");34 shouldThrow ("testAdd(null)");32 shouldThrowErrorName('testAdd("foo")', "TypeError"); 33 shouldThrowErrorName("testAdd(undefined)", "TypeError"); 34 shouldThrowErrorName("testAdd(null)", "TypeError"); 35 35 36 36 debug("<br>Call HTMLOptionsCollection.add() with two arguments:"); … … 77 77 shouldBeEqualToString('testAdd(createOption("Y25"), 0, 1)', "Y25,0,1,2"); 78 78 shouldBeEqualToString('testAdd(createOption("Y25"), mySelect.options[0], 1)', "Y25,0,1,2"); 79 shouldThrow ('testAdd("foo", 0)', "'TypeError: Type error'");80 shouldThrow ('testAdd(undefined, 0)', "'TypeError: Type error'");81 shouldThrow ('testAdd(null, 0)', "'TypeError: Type error'");79 shouldThrowErrorName('testAdd("foo", 0)', "TypeError"); 80 shouldThrowErrorName('testAdd(undefined, 0)', "TypeError"); 81 shouldThrowErrorName('testAdd(null, 0)', "TypeError"); 82 82 83 83 debug("<br>Call HTMLOptionsCollection.add() with three arguments (when it only takes two arguments):"); … … 86 86 shouldBeEqualToString('testAdd(createGroup("G1", "G2"), 1, "unnecessary extra argument - should be ignored")', "0,G1,G2,1,2"); 87 87 </script> 88 <script src="../../../resources/js-test-post.js"></script> 88 89 </body> 89 90 </html> -
trunk/LayoutTests/fast/dom/incompatible-operations-expected.txt
r203941 r204028 13 13 PASS aNode.lookupPrefix(void 0) is null 14 14 PASS aNode.cloneNode(aDOMImplementation) instanceof HTMLDivElement is true 15 PASS aSelect.add(aDOMImplementation, aDOMImplementation) threw exception TypeError: Type error.16 PASS aSelect.add(aDOMImplementation, anOption) threw exception TypeError: Type error.15 PASS aSelect.add(aDOMImplementation, aDOMImplementation) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 16 PASS aSelect.add(aDOMImplementation, anOption) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 17 17 PASS aSelect.add(anOption, aDOMImplementation) is undefined. 18 PASS aSelect.add(void 0, void 0) threw exception TypeError: Type error.19 PASS aSelect.add(void 0, anOption) threw exception TypeError: Type error.18 PASS aSelect.add(void 0, void 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 19 PASS aSelect.add(void 0, anOption) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement. 20 20 PASS aSelect.add(anOption, void 0) is undefined. 21 21 PASS successfullyParsed is true -
trunk/LayoutTests/js/dom/select-options-add-expected.txt
r178097 r204028 35 35 36 36 1.5 Add a non-element (string) 37 PASS select1.options.add(option1) threw exception TypeError: Type error.37 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 38 38 PASS select1.options.length is 3 39 39 PASS select1.selectedIndex is 0 40 40 41 41 1.6 Add a non-element (number) 42 PASS select1.options.add(option1) threw exception TypeError: Type error.42 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 43 43 PASS select1.options.length is 3 44 44 PASS select1.selectedIndex is 0 45 45 46 46 1.7 Add a non-element (boolean) 47 PASS select1.options.add(option1) threw exception TypeError: Type error.47 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 48 48 PASS select1.options.length is 3 49 49 PASS select1.selectedIndex is 0 50 50 51 51 1.8 Add undefined 52 PASS select1.options.add(option1) threw exception TypeError: Type error.52 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 53 53 PASS select1.options.length is 3 54 54 PASS select1.selectedIndex is 0 55 55 56 56 1.9 Add null 57 PASS select1.options.add(option1) threw exception TypeError: Type error.57 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 58 58 PASS select1.options.length is 3 59 59 PASS select1.selectedIndex is 0 60 60 61 61 1.10 Add negative infinity 62 PASS select1.options.add(option1) threw exception TypeError: Type error.62 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 63 63 PASS select1.options.length is 3 64 64 PASS select1.selectedIndex is 0 65 65 66 66 1.11 Add NaN 67 PASS select1.options.add(option1) threw exception TypeError: Type error.67 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 68 68 PASS select1.options.length is 3 69 69 PASS select1.selectedIndex is 0 70 70 71 71 1.12 Add positive infinity 72 PASS select1.options.add(option1) threw exception TypeError: Type error.72 PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 73 73 PASS select1.options.length is 3 74 74 PASS select1.selectedIndex is 0 … … 184 184 185 185 2.13 Add a non-element (string) 186 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.186 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 187 187 PASS select2.options.length is 11 188 188 PASS select2.selectedIndex is 4 189 189 190 190 2.14 Add a non-element (number) 191 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.191 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 192 192 PASS select2.options.length is 11 193 193 PASS select2.selectedIndex is 4 194 194 195 195 2.15 Add a non-element (boolean) 196 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.196 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 197 197 PASS select2.options.length is 11 198 198 PASS select2.selectedIndex is 4 199 199 200 200 2.16 Add undefined 201 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.201 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 202 202 PASS select2.options.length is 11 203 203 PASS select2.selectedIndex is 4 204 204 205 205 2.17 Add null 206 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.206 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 207 207 PASS select2.options.length is 11 208 208 PASS select2.selectedIndex is 4 209 209 210 210 2.18 Add negative infinity 211 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.211 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 212 212 PASS select2.options.length is 11 213 213 PASS select2.selectedIndex is 4 214 214 215 215 2.19 Add NaN 216 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.216 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 217 217 PASS select2.options.length is 11 218 218 PASS select2.selectedIndex is 4 219 219 220 220 2.20 Add positive infinity 221 PASS select2.options.add(option2, 1) threw exception TypeError: Type error.221 PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement. 222 222 PASS select2.options.length is 11 223 223 PASS select2.selectedIndex is 4 -
trunk/LayoutTests/webaudio/audiobuffer-expected.txt
r199775 r204028 13 13 PASS getChannelData(3) returns a Float32Array object. 14 14 PASS Exception has been thrown correctly when index is not less than numberOfChannels. 15 PASS context.createBuffer(null, false) threw exception TypeError: Type error.15 PASS context.createBuffer(null, false) threw exception TypeError: Argument 1 ('buffer') to webkitAudioContext.createBuffer must be an instance of ArrayBuffer. 16 16 PASS successfullyParsed is true 17 17 -
trunk/LayoutTests/webaudio/audiobuffer.html
r199775 r204028 50 50 } 51 51 52 shouldThrow ("context.createBuffer(null, false)", "'TypeError: Type error'");52 shouldThrowErrorName("context.createBuffer(null, false)", "TypeError"); 53 53 54 54 </script> -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html
r157888 r204028 72 72 } 73 73 74 if (expected == gl.INVALID_OPERATION ) {74 if (expected == gl.INVALID_OPERATION || expected == gl.INVALID_VALUE) { 75 75 glErrorShouldBe(gl, expected); 76 76 } else if (expected == "exception") { … … 90 90 gl.INVALID_OPERATION); 91 91 92 test("Passing texImage2D parameter data of Number type should throw an exception", 92 // We do not do strict type checking for ArrayBufferView type. 93 test("Passing texImage2D parameter data of Number type should generate an INVALID_OPERATION", 93 94 function () { 94 95 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, 42); 95 96 }, 96 "exception");97 gl.INVALID_OPERATION); 97 98 98 test("Passing texImage2D parameter data of String type should throw a TypeError",99 test("Passing texImage2D parameter data of String type should generate an INVALID_OPERATION", 99 100 function () { 100 101 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer"); 101 102 }, 102 "exception");103 gl.INVALID_OPERATION); 103 104 test("Passing a buffer not large enough to texSubImage2D should generate an INVALID_OPERATION", 104 105 function () { … … 108 109 gl.INVALID_OPERATION); 109 110 110 test("Passing texSubImage2D parameter data of Number type should throw a TypeError",111 test("Passing texSubImage2D parameter data of Number type should generate an INVALID_VALUE", 111 112 function () { 112 113 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, 42); 113 114 }, 114 "exception");115 gl.INVALID_VALUE); 115 116 116 test("Passing texSubImage2D parameter data of String type should throw a TypeError",117 test("Passing texSubImage2D parameter data of String type should generate an INVALID_VALUE", 117 118 function () { 118 119 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer"); 119 120 }, 120 "exception");121 gl.INVALID_VALUE); 121 122 122 123 debug(""); -
trunk/Source/WebCore/ChangeLog
r204027 r204028 1 2016-08-02 Chris Dumez <cdumez@apple.com> 2 3 [WebIDL] Implement overload resolution algorithm 4 https://bugs.webkit.org/show_bug.cgi?id=160394 5 6 Reviewed by Darin Adler. 7 8 Implement overload resolution algorithm: 9 - http://heycam.github.io/webidl/#es-overloads 10 11 This means that our support for operation overloading in our IDL is 12 now a lot more extensive than it used to be and is now compliant with 13 the Web IDL specification. 14 15 In particular, overloading should now work for a lot more parameter 16 types which means that: 17 - We should be able to drop some custom bindings code in a follow-up patch. 18 - We will be able to drop the [StrictTypeChecking] attribute which was 19 a hack used to make overloading work for parameters of type DOMString. 20 21 Also, the order of the overloads in the IDL no longer impacts the 22 generated bindings code. It used to be that you needed to put the 23 overloads with the more specific parameter types first in order for the 24 generated bindings code to be somewhat correct. 25 26 No new tests, rebaselined bindings tests. 27 28 * bindings/scripts/CodeGenerator.pm: 29 (IsStringOrEnumType): 30 * bindings/scripts/CodeGeneratorJS.pm: 31 (IsNullableType): 32 (StripNullable): 33 (ComputeEffectiveOverloadSet): 34 (AreTypesDistinguishableForOverloadResolution): 35 (GetDistinguishingArgumentIndex): 36 (GetOverloadThatMatches): 37 (GenerateOverloadedFunction): 38 * bindings/scripts/test/JS/JSTestGlobalObject.cpp: 39 (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation): 40 * bindings/scripts/test/JS/JSTestObj.cpp: 41 (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation): 42 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): 43 (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1): 44 (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter): 45 (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): 46 (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction): 47 (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted. 48 (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted. 49 * bindings/scripts/test/TestObj.idl: 50 * dom/EventTarget.h: 51 * dom/EventTarget.idl: 52 * html/HTMLOptionsCollection.h: 53 * html/HTMLOptionsCollection.idl: 54 * html/HTMLSelectElement.h: 55 (WebCore::HTMLSelectElement::add): 56 * html/HTMLSelectElement.idl: 57 1 58 2016-08-02 Myles C. Maxfield <mmaxfield@apple.com> 2 59 -
trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm
r203675 r204028 359 359 } 360 360 361 sub IsStringOrEnumType 362 { 363 my ($object, $type) = @_; 364 365 return 1 if $type eq "DOMString"; 366 return 1 if $object->IsEnumType($type); 367 return 0; 368 } 369 361 370 sub IsIntegerType 362 371 { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r203949 r204028 1644 1644 } 1645 1645 1646 sub IsNullableType 1647 { 1648 my $type = shift; 1649 1650 return substr($type, -1) eq "?"; 1651 } 1652 1653 sub StripNullable 1654 { 1655 my $type = shift; 1656 1657 chop($type) if IsNullableType($type); 1658 return $type; 1659 } 1660 1661 # This computes an effective overload set for a given operation / constructor, 1662 # which represents the allowable invocations.This set is used as input for 1663 # the Web IDL overload resolution algorithm. 1664 # http://heycam.github.io/webidl/#dfn-effective-overload-set 1665 sub ComputeEffectiveOverloadSet 1666 { 1667 my ($overloads) = @_; 1668 1669 my %allSets; 1670 my $addTuple = sub { 1671 my $tuple = shift; 1672 # The Web IDL specification uses a flat set of tuples but we use a hash where the key is the 1673 # number of parameters and the value is the set of tuples for the given number of parameters. 1674 my $length = scalar(@{@$tuple[1]}); 1675 if (!exists($allSets{$length})) { 1676 $allSets{$length} = [ $tuple ]; 1677 } else { 1678 push(@{$allSets{$length}}, $tuple); 1679 } 1680 }; 1681 1682 my $m = LengthOfLongestFunctionParameterList($overloads); 1683 foreach my $overload (@{$overloads}) { 1684 my $n = @{$overload->parameters}; 1685 my @t; 1686 my @o; 1687 my $isVariadic = 0; 1688 foreach my $parameter (@{$overload->parameters}) { 1689 push(@t, $parameter->isNullable ? $parameter->type . "?" : $parameter->type); 1690 if ($parameter->isOptional) { 1691 push(@o, "optional"); 1692 } elsif ($parameter->isVariadic) { 1693 push(@o, "variadic"); 1694 $isVariadic = 1; 1695 } else { 1696 push(@o, "required"); 1697 } 1698 } 1699 &$addTuple([$overload, [@t], [@o]]); 1700 if ($isVariadic) { 1701 my @newT = @t; 1702 my @newO = @o; 1703 for (my $i = $n; $i < $m; $i++) { 1704 push(@newT, $t[-1]); 1705 push(@newO, "variadic"); 1706 &$addTuple([$overload, [@newT], [@newO]]); 1707 } 1708 } 1709 for (my $i = $n - 1; $i >= 0; $i--) { 1710 my $parameter = @{$overload->parameters}[$i]; 1711 last unless ($parameter->isOptional || $parameter->isVariadic); 1712 pop(@t); 1713 pop(@o); 1714 &$addTuple([$overload, [@t], [@o]]); 1715 } 1716 } 1717 return %allSets; 1718 } 1719 1720 # Determines if two types are distinguishable in the context of overload resolution, 1721 # according to the Web IDL specification: 1722 # http://heycam.github.io/webidl/#dfn-distinguishable 1723 sub AreTypesDistinguishableForOverloadResolution 1724 { 1725 my ($typeA, $typeB) = @_; 1726 1727 my $isDictionary = sub { 1728 my $type = shift; 1729 return $type eq "Dictionary" || $codeGenerator->IsDictionaryType($type); 1730 }; 1731 my $isCallbackFunctionOrDictionary = sub { 1732 my $type = shift; 1733 return $codeGenerator->IsFunctionOnlyCallbackInterface($type) || &$isDictionary($type); 1734 }; 1735 1736 # FIXME: The WebIDL mandates this but this currently does not work because some of our IDL is wrong. 1737 # return 0 if IsNullableType($typeA) && IsNullableType($typeB); 1738 1739 $typeA = StripNullable($typeA); 1740 $typeB = StripNullable($typeB); 1741 1742 return 0 if $typeA eq $typeB; 1743 return 0 if $typeA eq "object" or $typeB eq "object"; 1744 return 0 if $codeGenerator->IsNumericType($typeA) && $codeGenerator->IsNumericType($typeB); 1745 return 0 if $codeGenerator->IsStringOrEnumType($typeA) && $codeGenerator->IsStringOrEnumType($typeB); 1746 return 0 if &$isDictionary($typeA) && &$isDictionary($typeB); 1747 return 0 if $codeGenerator->IsCallbackInterface($typeA) && $codeGenerator->IsCallbackInterface($typeB); 1748 return 0 if &$isCallbackFunctionOrDictionary($typeA) && &$isCallbackFunctionOrDictionary($typeB); 1749 return 0 if $codeGenerator->GetArrayOrSequenceType($typeA) && $codeGenerator->GetArrayOrSequenceType($typeB); 1750 # FIXME: return 0 if typeA and typeB are both exception types. 1751 return 1; 1752 } 1753 1754 # If there is more than one entry in an effective overload set that has a given type list length, 1755 # then for those entries there must be an index i such that for each pair of entries the types 1756 # at index i are distinguishable. The lowest such index is termed the distinguishing argument index. 1757 # http://heycam.github.io/webidl/#dfn-distinguishing-argument-index 1758 sub GetDistinguishingArgumentIndex 1759 { 1760 my ($function, $S) = @_; 1761 1762 # FIXME: Consider all the tuples, not just the 2 first ones? 1763 my $firstTupleTypes = @{@{$S}[0]}[1]; 1764 my $secondTupleTypes = @{@{$S}[1]}[1]; 1765 for (my $index = 0; $index < scalar(@$firstTupleTypes); $index++) { 1766 return $index if AreTypesDistinguishableForOverloadResolution(@{$firstTupleTypes}[$index], @{$secondTupleTypes}[$index]); 1767 } 1768 die "Undistinguishable overloads for operation " . $function->signature->name . " with length: " . scalar(@$firstTupleTypes); 1769 } 1770 1771 sub GetOverloadThatMatches 1772 { 1773 my ($S, $parameterIndex, $matches) = @_; 1774 1775 for my $tuple (@{$S}) { 1776 my $type = @{@{$tuple}[1]}[$parameterIndex]; 1777 my $optionality = @{@{$tuple}[2]}[$parameterIndex]; 1778 my $isNullable = IsNullableType($type); 1779 return @{$tuple}[0] if $matches->(StripNullable($type), $optionality, $isNullable); 1780 } 1781 } 1782 1783 # Implements the overload resolution algorithm, as defined in the Web IDL specification: 1784 # http://heycam.github.io/webidl/#es-overloads 1785 sub GenerateOverloadedFunction 1786 { 1787 my ($function, $interface) = @_; 1788 my %allSets = ComputeEffectiveOverloadSet($function->{overloads}); 1789 1790 my $kind = $function->isStatic ? "Constructor" : (OperationShouldBeOnInstance($interface, $function) ? "Instance" : "Prototype"); 1791 my $interfaceName = $interface->name; 1792 my $functionName = "js${interfaceName}${kind}Function" . $codeGenerator->WK_ucfirst($function->signature->name); 1793 1794 my $generateOverloadCallIfNecessary = sub { 1795 my ($overload, $condition) = @_; 1796 return unless $overload; 1797 my $conditionalString = $codeGenerator->GenerateConditionalString($overload->signature); 1798 push(@implContent, "#if ${conditionalString}\n") if $conditionalString; 1799 push(@implContent, " if ($condition)\n ") if $condition; 1800 push(@implContent, " return ${functionName}$overload->{overloadIndex}(state);\n"); 1801 push(@implContent, "#endif\n") if $conditionalString; 1802 }; 1803 my $isOptionalParameter = sub { 1804 my ($type, $optionality, $isNullable) = @_; 1805 return $optionality eq "optional"; 1806 }; 1807 my $isDictionaryParameter = sub { 1808 my ($type, $optionality, $isNullable) = @_; 1809 return $type eq "Dictionary" || $codeGenerator->IsDictionaryType($type); 1810 }; 1811 my $isNullableOrDictionaryParameter = sub { 1812 my ($type, $optionality, $isNullable) = @_; 1813 return $isNullable || &$isDictionaryParameter($type, $optionality, $isNullable); 1814 }; 1815 my $isRegExpOrObjectParameter = sub { 1816 my ($type, $optionality, $isNullable) = @_; 1817 return $type eq "RegExp" || $type eq "object"; 1818 }; 1819 my $isObjectOrErrorParameter = sub { 1820 my ($type, $optionality, $isNullable) = @_; 1821 return $type eq "object" || $type eq "Error"; 1822 }; 1823 my $isObjectOrErrorOrDOMExceptionParameter = sub { 1824 my ($type, $optionality, $isNullable) = @_; 1825 return 1 if &$isObjectOrErrorParameter($type, $optionality, $isNullable); 1826 return $type eq "DOMException"; 1827 }; 1828 my $isObjectOrCallbackFunctionParameter = sub { 1829 my ($type, $optionality, $isNullable) = @_; 1830 return $type eq "object" || $codeGenerator->IsFunctionOnlyCallbackInterface($type); 1831 }; 1832 my $isArrayOrSequenceParameter = sub { 1833 my ($type, $optionality, $isNullable) = @_; 1834 return $codeGenerator->GetArrayOrSequenceType($type); 1835 }; 1836 my $isDictionaryOrObjectOrCallbackInterfaceParameter = sub { 1837 my ($type, $optionality, $isNullable) = @_; 1838 return 1 if &$isDictionaryParameter($type, $optionality, $isNullable); 1839 return 1 if $type eq "object"; 1840 return 1 if $codeGenerator->IsCallbackInterface($type) && !$codeGenerator->IsFunctionOnlyCallbackInterface($type); 1841 return 0; 1842 }; 1843 my $isBooleanParameter = sub { 1844 my ($type, $optionality, $isNullable) = @_; 1845 return $type eq "boolean"; 1846 }; 1847 my $isNumericParameter = sub { 1848 my ($type, $optionality, $isNullable) = @_; 1849 return $codeGenerator->IsNumericType($type); 1850 }; 1851 my $isStringOrEnumParameter = sub { 1852 my ($type, $optionality, $isNullable) = @_; 1853 return $codeGenerator->IsStringOrEnumType($type); 1854 }; 1855 my $isAnyParameter = sub { 1856 my ($type, $optionality, $isNullable) = @_; 1857 return $type eq "any"; 1858 }; 1859 1860 my $maxArgCount = LengthOfLongestFunctionParameterList($function->{overloads}); 1861 1862 push(@implContent, <<END); 1863 EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* state) 1864 { 1865 size_t argsCount = std::min<size_t>($maxArgCount, state->argumentCount()); 1866 END 1867 1868 for my $length ( sort keys %allSets ) { 1869 push(@implContent, <<END); 1870 if (argsCount == $length) { 1871 END 1872 my $S = $allSets{$length}; 1873 if (scalar(@$S) > 1) { 1874 my $d = GetDistinguishingArgumentIndex($function, $S); 1875 push(@implContent, " JSValue distinguishingArg = state->uncheckedArgument($d);\n"); 1876 1877 my $overload = GetOverloadThatMatches($S, $d, \&$isOptionalParameter); 1878 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isUndefined()"); 1879 1880 $overload = GetOverloadThatMatches($S, $d, \&$isNullableOrDictionaryParameter); 1881 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isUndefinedOrNull()"); 1882 1883 for my $tuple (@{$S}) { 1884 my $overload = @{$tuple}[0]; 1885 my $type = StripNullable(@{@{$tuple}[1]}[$d]); 1886 if ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type)) { 1887 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JS${type}::info())"); 1888 } 1889 } 1890 1891 $overload = GetOverloadThatMatches($S, $d, \&$isRegExpOrObjectParameter); 1892 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->type() == RegExpObjectType"); 1893 1894 $overload = GetOverloadThatMatches($S, $d, \&$isObjectOrErrorOrDOMExceptionParameter); 1895 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSDOMCoreException::info())"); 1896 1897 $overload = GetOverloadThatMatches($S, $d, \&$isObjectOrErrorParameter); 1898 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->type() == ErrorInstanceType"); 1899 1900 $overload = GetOverloadThatMatches($S, $d, \&$isObjectOrCallbackFunctionParameter); 1901 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isFunction()"); 1902 1903 $overload = GetOverloadThatMatches($S, $d, \&$isArrayOrSequenceParameter); 1904 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && isJSArray(distinguishingArg)"); 1905 1906 $overload = GetOverloadThatMatches($S, $d, \&$isDictionaryOrObjectOrCallbackInterfaceParameter); 1907 &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->type() != RegExpObjectType"); 1908 1909 my $booleanOverload = GetOverloadThatMatches($S, $d, \&$isBooleanParameter); 1910 &$generateOverloadCallIfNecessary($booleanOverload, "distinguishingArg.isBoolean()"); 1911 1912 my $numericOverload = GetOverloadThatMatches($S, $d, \&$isNumericParameter); 1913 &$generateOverloadCallIfNecessary($numericOverload, "distinguishingArg.isNumber()"); 1914 1915 # Fallbacks. 1916 $overload = GetOverloadThatMatches($S, $d, \&$isStringOrEnumParameter); 1917 if ($overload) { 1918 &$generateOverloadCallIfNecessary($overload); 1919 } elsif ($numericOverload) { 1920 &$generateOverloadCallIfNecessary($numericOverload); 1921 } elsif ($booleanOverload) { 1922 &$generateOverloadCallIfNecessary($booleanOverload); 1923 } else { 1924 $overload = GetOverloadThatMatches($S, $d, \&$isAnyParameter); 1925 &$generateOverloadCallIfNecessary($overload); 1926 } 1927 } else { 1928 # Only 1 overload with this number of parameters. 1929 my $overload = @{@{$S}[0]}[0]; 1930 &$generateOverloadCallIfNecessary($overload); 1931 } 1932 push(@implContent, <<END); 1933 } 1934 END 1935 } 1936 my $minArgCount = GetFunctionLength($function); 1937 if ($minArgCount > 0) { 1938 push(@implContent, " return argsCount < $minArgCount ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);\n") 1939 } else { 1940 push(@implContent, " return throwVMTypeError(state);\n") 1941 } 1942 push(@implContent, "}\n\n"); 1943 } 1944 1646 1945 sub GenerateParametersCheckExpression 1647 1946 { … … 1767 2066 } 1768 2067 return $result; 1769 }1770 1771 sub GenerateOverloadedFunction1772 {1773 my ($function, $interface) = @_;1774 1775 # Generate code for choosing the correct overload to call. Overloads are1776 # chosen based on the total number of arguments passed and the type of1777 # values passed in non-primitive argument slots. When more than a single1778 # overload is applicable, precedence is given according to the order of1779 # declaration in the IDL.1780 1781 my $kind = $function->isStatic ? "Constructor" : (OperationShouldBeOnInstance($interface, $function) ? "Instance" : "Prototype");1782 my $interfaceName = $interface->name;1783 my $functionName = "js${interfaceName}${kind}Function" . $codeGenerator->WK_ucfirst($function->signature->name);1784 1785 # FIXME: Implement support for overloaded functions with variadic arguments.1786 my $lengthOfLongestOverloadedFunctionParameterList = LengthOfLongestFunctionParameterList($function->{overloads});1787 1788 push(@implContent, "EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* state)\n");1789 push(@implContent, <<END);1790 {1791 size_t argsCount = std::min<size_t>($lengthOfLongestOverloadedFunctionParameterList, state->argumentCount());1792 END1793 1794 my %fetchedArguments = ();1795 my $leastNumMandatoryParams = 255;1796 1797 foreach my $overload (@{$function->{overloads}}) {1798 my ($numMandatoryParams, $parametersCheck, @neededArguments) = GenerateFunctionParametersCheck($overload);1799 $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams < $leastNumMandatoryParams);1800 1801 foreach my $parameterIndex (@neededArguments) {1802 next if exists $fetchedArguments{$parameterIndex};1803 push(@implContent, " JSValue arg$parameterIndex(state->argument($parameterIndex));\n");1804 $fetchedArguments{$parameterIndex} = 1;1805 }1806 1807 my $conditionalString = $codeGenerator->GenerateConditionalString($overload->signature);1808 push(@implContent, "#if ${conditionalString}\n") if $conditionalString;1809 1810 push(@implContent, " if ($parametersCheck)\n");1811 push(@implContent, " return ${functionName}$overload->{overloadIndex}(state);\n");1812 push(@implContent, "#endif\n\n") if $conditionalString;1813 1814 }1815 if ($leastNumMandatoryParams >= 1) {1816 push(@implContent, " if (UNLIKELY(argsCount < $leastNumMandatoryParams))\n");1817 push(@implContent, " return throwVMError(state, createNotEnoughArgumentsError(state));\n");1818 }1819 push(@implContent, <<END);1820 return throwVMTypeError(state);1821 }1822 1823 END1824 2068 } 1825 2069 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
r203675 r204028 399 399 { 400 400 size_t argsCount = std::min<size_t>(1, state->argumentCount()); 401 #if ENABLE(TEST_FEATURE) 402 if (argsCount == 1) 401 if (argsCount == 1) { 402 JSValue distinguishingArg = state->uncheckedArgument(0); 403 #if ENABLE(TEST_FEATURE) 404 if (distinguishingArg.isNumber()) 405 return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(state); 406 #endif 407 #if ENABLE(TEST_FEATURE) 403 408 return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1(state); 404 409 #endif 405 406 #if ENABLE(TEST_FEATURE) 407 if (argsCount == 1) 408 return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(state); 409 #endif 410 411 if (UNLIKELY(argsCount < 1)) 412 return throwVMError(state, createNotEnoughArgumentsError(state)); 413 return throwVMTypeError(state); 410 } 411 return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state); 414 412 } 415 413 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r203956 r204028 3870 3870 { 3871 3871 size_t argsCount = std::min<size_t>(1, state->argumentCount()); 3872 if (argsCount == 1) { 3873 JSValue distinguishingArg = state->uncheckedArgument(0); 3872 3874 #if ENABLE(TEST_FEATURE) 3873 if (argsCount == 1) 3875 if (distinguishingArg.isNumber()) 3876 return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2(state); 3877 #endif 3878 #if ENABLE(TEST_FEATURE) 3874 3879 return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1(state); 3875 3880 #endif 3876 3877 #if ENABLE(TEST_FEATURE) 3878 if (argsCount == 1) 3879 return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2(state); 3880 #endif 3881 3882 if (UNLIKELY(argsCount < 1)) 3883 return throwVMError(state, createNotEnoughArgumentsError(state)); 3884 return throwVMTypeError(state); 3881 } 3882 return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state); 3885 3883 } 3886 3884 … … 5423 5421 { 5424 5422 size_t argsCount = std::min<size_t>(2, state->argumentCount()); 5425 JSValue arg0(state->argument(0)); 5426 JSValue arg1(state->argument(1)); 5427 if ((argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))) && (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject()))) 5423 if (argsCount == 0) { 5424 return jsTestObjPrototypeFunctionOverloadedMethod12(state); 5425 } 5426 if (argsCount == 1) { 5427 JSValue distinguishingArg = state->uncheckedArgument(0); 5428 if (distinguishingArg.isUndefinedOrNull()) 5429 return jsTestObjPrototypeFunctionOverloadedMethod2(state); 5430 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestObj::info())) 5431 return jsTestObjPrototypeFunctionOverloadedMethod2(state); 5432 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestCallback::info())) 5433 return jsTestObjPrototypeFunctionOverloadedMethod5(state); 5434 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSDOMStringList::info())) 5435 return jsTestObjPrototypeFunctionOverloadedMethod6(state); 5436 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestObj::info())) 5437 return jsTestObjPrototypeFunctionOverloadedMethod8(state); 5438 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSBlob::info())) 5439 return jsTestObjPrototypeFunctionOverloadedMethod12(state); 5440 if (distinguishingArg.isObject() && isJSArray(distinguishingArg)) 5441 return jsTestObjPrototypeFunctionOverloadedMethod7(state); 5442 if (distinguishingArg.isObject() && asObject(distinguishingArg)->type() != RegExpObjectType) 5443 return jsTestObjPrototypeFunctionOverloadedMethod5(state); 5444 if (distinguishingArg.isNumber()) 5445 return jsTestObjPrototypeFunctionOverloadedMethod4(state); 5446 return jsTestObjPrototypeFunctionOverloadedMethod3(state); 5447 } 5448 if (argsCount == 2) { 5449 JSValue distinguishingArg = state->uncheckedArgument(1); 5450 if (distinguishingArg.isUndefined()) 5451 return jsTestObjPrototypeFunctionOverloadedMethod2(state); 5452 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSBlob::info())) 5453 return jsTestObjPrototypeFunctionOverloadedMethod12(state); 5454 if (distinguishingArg.isNumber()) 5455 return jsTestObjPrototypeFunctionOverloadedMethod2(state); 5428 5456 return jsTestObjPrototypeFunctionOverloadedMethod1(state); 5429 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))))) 5430 return jsTestObjPrototypeFunctionOverloadedMethod2(state); 5431 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject()))) 5432 return jsTestObjPrototypeFunctionOverloadedMethod3(state); 5433 if (argsCount == 1) 5434 return jsTestObjPrototypeFunctionOverloadedMethod4(state); 5435 if ((argsCount == 1 && (arg0.isNull() || arg0.isObject()))) 5436 return jsTestObjPrototypeFunctionOverloadedMethod5(state); 5437 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSDOMStringList::info()))))) 5438 return jsTestObjPrototypeFunctionOverloadedMethod6(state); 5439 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && isJSArray(arg0))))) 5440 return jsTestObjPrototypeFunctionOverloadedMethod7(state); 5441 if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))))) 5442 return jsTestObjPrototypeFunctionOverloadedMethod8(state); 5443 if ((argsCount == 1 && ((arg0.isObject() && isJSArray(arg0))))) 5444 return jsTestObjPrototypeFunctionOverloadedMethod9(state); 5445 if ((argsCount == 1 && ((arg0.isObject() && isJSArray(arg0))))) 5446 return jsTestObjPrototypeFunctionOverloadedMethod10(state); 5447 if (argsCount == 1) 5448 return jsTestObjPrototypeFunctionOverloadedMethod11(state); 5449 if () 5450 return jsTestObjPrototypeFunctionOverloadedMethod12(state); 5451 if (UNLIKELY(argsCount < 1)) 5452 return throwVMError(state, createNotEnoughArgumentsError(state)); 5457 } 5453 5458 return throwVMTypeError(state); 5454 5459 } … … 5464 5469 if (UNLIKELY(state->argumentCount() < 1)) 5465 5470 return throwVMError(state, createNotEnoughArgumentsError(state)); 5466 TestObj* objArg1 = nullptr; 5467 if (!state->argument(0).isUndefinedOrNull()) { 5468 objArg1 = JSTestObj::toWrapped(state->uncheckedArgument(0)); 5469 if (UNLIKELY(!objArg1)) 5470 return throwArgumentTypeError(*state, 0, "objArg1", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj"); 5471 } 5472 TestObj* objArg2 = nullptr; 5471 auto strArg = state->argument(0).toWTFString(state); 5472 if (UNLIKELY(state->hadException())) 5473 return JSValue::encode(jsUndefined()); 5474 TestObj* objArg = nullptr; 5473 5475 if (!state->argument(1).isUndefinedOrNull()) { 5474 objArg 2= JSTestObj::toWrapped(state->uncheckedArgument(1));5475 if (UNLIKELY(!objArg 2))5476 return throwArgumentTypeError(*state, 1, "objArg 2", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj");5477 } 5478 impl.overloadedMethodWithOptionalParameter(WTFMove( objArg1), WTFMove(objArg2));5476 objArg = JSTestObj::toWrapped(state->uncheckedArgument(1)); 5477 if (UNLIKELY(!objArg)) 5478 return throwArgumentTypeError(*state, 1, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj"); 5479 } 5480 impl.overloadedMethodWithOptionalParameter(WTFMove(strArg), WTFMove(objArg)); 5479 5481 return JSValue::encode(jsUndefined()); 5480 5482 } … … 5506 5508 { 5507 5509 size_t argsCount = std::min<size_t>(2, state->argumentCount()); 5508 JSValue arg0(state->argument(0)); 5509 JSValue arg1(state->argument(1)); 5510 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))) && (arg1.isUndefinedOrNull() || (arg1.isObject() && asObject(arg1)->inherits(JSTestObj::info()))))) 5510 if (argsCount == 1) { 5511 JSValue distinguishingArg = state->uncheckedArgument(0); 5512 if (distinguishingArg.isUndefinedOrNull()) 5513 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state); 5514 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestObj::info())) 5515 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state); 5511 5516 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1(state); 5512 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))))) 5513 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state); 5514 if (UNLIKELY(argsCount < 1)) 5515 return throwVMError(state, createNotEnoughArgumentsError(state)); 5516 return throwVMTypeError(state); 5517 } 5518 if (argsCount == 2) { 5519 JSValue distinguishingArg = state->uncheckedArgument(0); 5520 if (distinguishingArg.isUndefinedOrNull()) 5521 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state); 5522 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSTestObj::info())) 5523 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state); 5524 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1(state); 5525 } 5526 return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state); 5517 5527 } 5518 5528 … … 5570 5580 { 5571 5581 size_t argsCount = std::min<size_t>(1, state->argumentCount()); 5582 if (argsCount == 1) { 5583 JSValue distinguishingArg = state->uncheckedArgument(0); 5572 5584 #if ENABLE(Condition1) 5573 if (argsCount == 1) 5574 return jsTestObjConstructorFunctionOverloadedMethod11(state); 5575 #endif 5576 5577 JSValue arg0(state->argument(0)); 5585 if (distinguishingArg.isNumber()) 5586 return jsTestObjConstructorFunctionOverloadedMethod11(state); 5587 #endif 5578 5588 #if ENABLE(Condition1) 5579 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))5580 5589 return jsTestObjConstructorFunctionOverloadedMethod12(state); 5581 5590 #endif 5582 5583 if (UNLIKELY(argsCount < 1)) 5584 return throwVMError(state, createNotEnoughArgumentsError(state)); 5585 return throwVMTypeError(state); 5591 } 5592 return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state); 5586 5593 } 5587 5594 … … 6083 6090 { 6084 6091 size_t argsCount = std::min<size_t>(1, state->argumentCount()); 6085 if (argsCount == 1) 6092 if (argsCount == 1) { 6093 JSValue distinguishingArg = state->uncheckedArgument(0); 6094 if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JSFetchRequest::info())) 6095 return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2(state); 6096 if (distinguishingArg.isNumber()) 6097 return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1(state); 6086 6098 return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1(state); 6087 JSValue arg0(state->argument(0)); 6088 if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSFetchRequest::info()))))) 6089 return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2(state); 6090 if (UNLIKELY(argsCount < 1)) 6091 return throwVMError(state, createNotEnoughArgumentsError(state)); 6092 return throwVMTypeError(state); 6099 } 6100 return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state); 6093 6101 } 6094 6102 -
trunk/Source/WebCore/bindings/scripts/test/TestObj.idl
r203956 r204028 267 267 void overloadedMethod(Blob... blobArgs); 268 268 269 void overloadedMethodWithOptionalParameter( TestObj? objArg1, optional TestObj? objArg2= null);269 void overloadedMethodWithOptionalParameter(DOMString strArg, optional TestObj? objArg = null); 270 270 void overloadedMethodWithOptionalParameter(TestObj? objArg, optional long longArg); 271 271 #endif … … 278 278 // Static method with conditional on overloaded methods 279 279 [Conditional=Condition1] static void overloadedMethod1(long arg); 280 [Conditional=Condition1] static void overloadedMethod1( [StrictTypeChecking]DOMString type);280 [Conditional=Condition1] static void overloadedMethod1(DOMString type); 281 281 282 282 void classMethodWithClamp([Clamp] unsigned short objArgsShort, [Clamp] unsigned long objArgsLong); -
trunk/Source/WebCore/dom/EventTarget.h
r203391 r204028 140 140 }; 141 141 142 void addEventListenerForBindings(const AtomicString& eventType, RefPtr<EventListener>&&, bool useCapture );143 void removeEventListenerForBindings(const AtomicString& eventType, RefPtr<EventListener>&&, bool useCapture );142 void addEventListenerForBindings(const AtomicString& eventType, RefPtr<EventListener>&&, bool useCapture = false); 143 void removeEventListenerForBindings(const AtomicString& eventType, RefPtr<EventListener>&&, bool useCapture = false); 144 144 void addEventListenerForBindings(const AtomicString& eventType, RefPtr<EventListener>&&, const AddEventListenerOptions&); 145 145 void removeEventListenerForBindings(const AtomicString& eventType, RefPtr<EventListener>&&, const ListenerOptions&); -
trunk/Source/WebCore/dom/EventTarget.idl
r203391 r204028 28 28 ] interface EventTarget { 29 29 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 30 [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, optional AddEventListenerOptions options); 31 [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, optional EventListenerOptions options); 30 // FIXME: Should be: 31 // void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options); 32 // void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options); 33 [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener); 34 [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, AddEventListenerOptions options); 35 [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener); 36 [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, EventListenerOptions options); 32 37 #endif 33 38 34 [ObjCLegacyUnnamedParameters, ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, optional boolean useCapture = false);35 [ObjCLegacyUnnamedParameters, ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, optional boolean useCapture = false);39 [ObjCLegacyUnnamedParameters, ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, boolean useCapture); 40 [ObjCLegacyUnnamedParameters, ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, boolean useCapture); 36 41 37 42 [ImplementedAs=dispatchEventForBindings, RaisesException] boolean dispatchEvent(Event event); -
trunk/Source/WebCore/html/HTMLOptionsCollection.h
r199335 r204028 45 45 void add(HTMLElement&, HTMLElement* beforeElement, ExceptionCode&); 46 46 void add(HTMLElement&, int beforeIndex, ExceptionCode&); 47 void add(HTMLElement& element, ExceptionCode& ec) { add(element, nullptr, ec); } 47 48 void remove(int index); 48 49 void remove(HTMLOptionElement&); -
trunk/Source/WebCore/html/HTMLOptionsCollection.idl
r203797 r204028 35 35 36 36 #if (!defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C) && (!defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT) 37 [RaisesException] void add(HTMLElement element, optional HTMLElement? before = null); 38 [RaisesException] void add(HTMLElement element, optional long index = 0); 37 // FIXME: Should be: 38 // void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null); 39 [RaisesException] void add(HTMLElement element); 40 [RaisesException] void add(HTMLElement element, HTMLElement? before); 41 [RaisesException] void add(HTMLElement element, long index); 39 42 #else 40 43 [RaisesException] void add(HTMLOptionElement option, unsigned long index); -
trunk/Source/WebCore/html/HTMLSelectElement.h
r201739 r204028 55 55 void add(HTMLElement&, HTMLElement* beforeElement, ExceptionCode&); 56 56 void add(HTMLElement&, int beforeIndex, ExceptionCode&); 57 void add(HTMLElement& element, ExceptionCode& ec) { add(element, nullptr, ec); } 57 58 58 59 using Node::remove; -
trunk/Source/WebCore/html/HTMLSelectElement.idl
r203797 r204028 54 54 #endif 55 55 56 [ObjCLegacyUnnamedParameters, RaisesException] void add(HTMLElement element, optional HTMLElement? before = null);56 [ObjCLegacyUnnamedParameters, RaisesException] void add(HTMLElement element, HTMLElement? before); 57 57 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 58 [RaisesException] void add(HTMLElement element, optional long index = 0); 58 // FIXME: Should be: 59 // void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null); 60 [RaisesException] void add(HTMLElement element, long index); 61 [RaisesException] void add(HTMLElement element); 62 59 63 // In JavaScript, we support both option index and option object parameters. 60 64 // As of this writing this cannot be auto-generated.
Note: See TracChangeset
for help on using the changeset viewer.