Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 296403007: Set correct Function.length on overloaded methods (Closed)

Created:
6 years, 7 months ago by Jens Widell
Modified:
6 years, 6 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Set correct Function.length on overloaded and variadic methods According to WebIDL, the Function.length property should be the length of shortest argument list in the effective overload set for argument count 0. This means for instance that variadic arguments don't contribute to the length. BUG=377718 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175559

Patch Set 1 #

Total comments: 6

Patch Set 2 : rebased #

Patch Set 3 : fix variadics + add tests #

Total comments: 4

Patch Set 4 : move logic to Python #

Total comments: 5

Patch Set 5 : addressed nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -10 lines) Patch
M LayoutTests/fast/js/function-length.html View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M LayoutTests/fast/js/function-length-expected.txt View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M Source/bindings/scripts/v8_interface.py View 1 2 3 4 2 chunks +26 lines, -0 lines 0 comments Download
M Source/bindings/templates/interface.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 1 chunk +6 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Jens Widell
PTAL. This doesn't change CG, since the methods for which length is calculated is still ...
6 years, 7 months ago (2014-05-27 12:07:21 UTC) #1
Jens Widell
https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp#newcode418 Source/bindings/templates/methods.cpp:418: {{method.number_of_required_or_variadic_arguments}} This value is actually wrong per spec. It ...
6 years, 7 months ago (2014-05-27 12:11:21 UTC) #2
jsbell
Are there any tests for function lengths? Should we add some samples to Internals.idl (or ...
6 years, 7 months ago (2014-05-27 18:10:50 UTC) #3
Jens Widell
On 2014/05/27 18:10:50, jsbell wrote: > Are there any tests for function lengths? Should we ...
6 years, 7 months ago (2014-05-27 18:27:26 UTC) #4
Jens Widell
https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp#newcode416 Source/bindings/templates/methods.cpp:416: {{method.overloads.minarg}} This is of course possibly incorrect if the ...
6 years, 6 months ago (2014-06-02 08:46:43 UTC) #5
Jens Widell
On 2014/05/27 18:10:50, jsbell wrote: > Are there any tests for function lengths? Should we ...
6 years, 6 months ago (2014-06-02 08:59:06 UTC) #6
Nils Barth (inactive)
Looks ok, with 2 significant changes requested: * Add a check/FIXME for when runtime features ...
6 years, 6 months ago (2014-06-04 07:22:02 UTC) #7
Nils Barth (inactive)
https://codereview.chromium.org/296403007/diff/40001/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/296403007/diff/40001/Source/bindings/templates/methods.cpp#newcode423 Source/bindings/templates/methods.cpp:423: {% macro method_length(method) %} Also, could you quote the ...
6 years, 6 months ago (2014-06-04 07:30:50 UTC) #8
Jens Widell
https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp#newcode416 Source/bindings/templates/methods.cpp:416: {{method.overloads.minarg}} On 2014/06/04 07:22:02, Nils Barth wrote: > On ...
6 years, 6 months ago (2014-06-04 07:38:36 UTC) #9
Nils Barth (inactive)
https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/296403007/diff/1/Source/bindings/templates/methods.cpp#newcode416 Source/bindings/templates/methods.cpp:416: {{method.overloads.minarg}} On 2014/06/04 07:38:36, Jens Lindström wrote: > I ...
6 years, 6 months ago (2014-06-04 08:12:01 UTC) #10
Jens Widell
Patch updated with moved logic, some commentary, and a check that Function.length doesn't need to ...
6 years, 6 months ago (2014-06-04 11:12:54 UTC) #11
Nils Barth (inactive)
LGTM with nits, thanks for a great CL! https://codereview.chromium.org/296403007/diff/40001/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/296403007/diff/40001/Source/bindings/templates/methods.cpp#newcode423 Source/bindings/templates/methods.cpp:423: {% ...
6 years, 6 months ago (2014-06-05 00:26:22 UTC) #12
haraken
LGTM https://codereview.chromium.org/296403007/diff/60001/LayoutTests/fast/js/function-length.html File LayoutTests/fast/js/function-length.html (right): https://codereview.chromium.org/296403007/diff/60001/LayoutTests/fast/js/function-length.html#newcode31 LayoutTests/fast/js/function-length.html:31: shouldBe('CanvasRenderingContext2D.prototype.drawImage.length', '3'); Just to confirm: These test cases ...
6 years, 6 months ago (2014-06-05 00:58:56 UTC) #13
Jens Widell
On 2014/06/05 00:58:56, haraken wrote: > LGTM > > https://codereview.chromium.org/296403007/diff/60001/LayoutTests/fast/js/function-length.html > File LayoutTests/fast/js/function-length.html (right): > ...
6 years, 6 months ago (2014-06-05 06:22:06 UTC) #14
haraken
On 2014/06/05 06:22:06, Jens Lindström wrote: > On 2014/06/05 00:58:56, haraken wrote: > > LGTM ...
6 years, 6 months ago (2014-06-05 07:05:00 UTC) #15
Nils Barth (inactive)
On 2014/06/05 07:05:00, haraken wrote: > On 2014/06/05 06:22:06, Jens Lindström wrote: > > Why ...
6 years, 6 months ago (2014-06-05 07:07:01 UTC) #16
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 6 months ago (2014-06-05 08:49:04 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/296403007/80001
6 years, 6 months ago (2014-06-05 08:49:53 UTC) #18
commit-bot: I haz the power
6 years, 6 months ago (2014-06-05 11:29:00 UTC) #19
Message was sent while issue was closed.
Change committed as 175559

Powered by Google App Engine
This is Rietveld 408576698