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

Issue 2118633002: Don't use => on void functions. (Closed)

Created:
4 years, 5 months ago by floitsch
Modified:
4 years, 5 months ago
Reviewers:
Alan Knight, sra1
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -12 lines) Patch
M sdk/lib/web_audio/dart2js/web_audio_dart2js.dart View 1 chunk +6 lines, -4 lines 3 comments Download
M sdk/lib/web_audio/dartium/web_audio_dartium.dart View 1 chunk +6 lines, -4 lines 0 comments Download
M tools/dom/templates/html/impl/impl_AudioNode.darttemplate View 1 chunk +6 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
floitsch
First part of a fix for http://dartbug.com/26740. Please add a test and then land it ...
4 years, 5 months ago (2016-07-08 16:14:37 UTC) #2
Alan Knight
This seems reasonable enough by itself, but when did this become an error? There are ...
4 years, 5 months ago (2016-07-08 16:35:50 UTC) #4
floitsch
On 2016/07/08 16:35:50, Alan Knight wrote: > This seems reasonable enough by itself, but when ...
4 years, 5 months ago (2016-07-08 16:37:50 UTC) #5
floitsch
https://codereview.chromium.org/2118633002/diff/1/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart File sdk/lib/web_audio/dart2js/web_audio_dart2js.dart (right): https://codereview.chromium.org/2118633002/diff/1/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart#newcode479 sdk/lib/web_audio/dart2js/web_audio_dart2js.dart:479: void _connect(destination, [int output, int input]) native; Fwiw: the ...
4 years, 5 months ago (2016-07-08 18:02:32 UTC) #6
sra1
lgtm https://codereview.chromium.org/2118633002/diff/1/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart File sdk/lib/web_audio/dart2js/web_audio_dart2js.dart (right): https://codereview.chromium.org/2118633002/diff/1/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart#newcode479 sdk/lib/web_audio/dart2js/web_audio_dart2js.dart:479: void _connect(destination, [int output, int input]) native; On ...
4 years, 5 months ago (2016-07-08 18:12:03 UTC) #8
floitsch
https://codereview.chromium.org/2118633002/diff/1/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart File sdk/lib/web_audio/dart2js/web_audio_dart2js.dart (right): https://codereview.chromium.org/2118633002/diff/1/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart#newcode479 sdk/lib/web_audio/dart2js/web_audio_dart2js.dart:479: void _connect(destination, [int output, int input]) native; On 2016/07/08 ...
4 years, 5 months ago (2016-07-11 12:20:04 UTC) #9
floitsch
Committed patchset #1 (id:1) manually as badabcc53a3256547e6365326798f808d39a343c (presubmit successful).
4 years, 5 months ago (2016-07-11 12:20:18 UTC) #11
floitsch
I landed this CL and I will do a cherry-pick for the next release. However, ...
4 years, 5 months ago (2016-07-11 12:22:39 UTC) #12
Alan Knight
On 2016/07/11 12:22:39, floitsch wrote: > I landed this CL and I will do a ...
4 years, 5 months ago (2016-07-11 23:08:44 UTC) #13
floitsch
4 years, 5 months ago (2016-07-12 12:51:34 UTC) #14
Message was sent while issue was closed.
On 2016/07/11 23:08:44, Alan Knight wrote:
> On 2016/07/11 12:22:39, floitsch wrote:
> > I landed this CL and I will do a cherry-pick for the next release.
> > However, there is still a test missing.
> > @Alan: could you please add a test to the html test-suite so this can't
> regress.
> > thanks.
> 
> The underlying problem here is that the Chrome IDL has changed from version
46,
> and connectNode no longer has a void return type. This fix seems like it's
just
> introducing a bug for a later date that we discard a valid return value.
> 
> If I revert the change, then html/audiocontext_test already fails in
> dart2js/chrome/checked locally. However, it crashes under drt, and is
suppressed
> there, and it seems we only run checked tests under drt. If I attempt to write
> something that uses the value, so it could fail not in checked mode, then it
> fails to compile. 
> 
> After discussions with Stephen, I'm thinking the actions are
>  - File a bug to have the compiler enforce void, that is automatically discard
a
> return value. Maybe only in the case of calling native things.
>  - File a bug to remove this fix once we regenerate dart:html
>  - Ask to have checked mode run on Chrome on the bots, not just drt.

There is more to it: yes, the code was broken because of an IDL change. However,
the templates are hand-written and advertise a `void` return value. When
updating to a new IDL there was nothing that could have prevented us to manually
fix things.
- either we don't return (which is what this CL does). In this case we need to
change the return type of the template and return the "new" value.
- we return (before this CL), but due to the 'void' return type on the template,
it crashes in checked mode.

Imho, there shouldn't be a bug to "remove this fix", but to "update the
template". After all, the template was written under different assumptions.
Clearly, we should also have more tests (or run them more).

Powered by Google App Engine
This is Rietveld 408576698