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

Issue 2974763002: Don't allow function values in assert tests. (Closed)

Created:
3 years, 5 months ago by Lasse Reichstein Nielsen
Modified:
3 years, 4 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Don't allow function values in assert tests. Currently you can write assert(() { ... }); and the function will be called and the return value used as the assert test. This feature isn't really worth its own complexity - if you want to get the same effect, you can just write all the function: assert(() { ... }()); With asserts in const initializer lists, where the function call is not possible anyway, the feature went from being not very useful to being actual an complication and exception for users to remember. R=eernst@google.com, rnystrom@google.com Committed: https://github.com/dart-lang/sdk/commit/e329e1ce29247512987434fd9a75bc518416d7ed

Patch Set 1 #

Total comments: 7

Patch Set 2 : Merge to head, address comments. #

Total comments: 1

Patch Set 3 : Address comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -17 lines) Patch
M docs/language/dartLangSpec.tex View 1 2 3 chunks +13 lines, -17 lines 1 comment Download

Messages

Total messages: 11 (3 generated)
Lasse Reichstein Nielsen
Let's just do it. We won't remove the feature from the implementations until Dart 2.0, ...
3 years, 5 months ago (2017-07-10 09:38:45 UTC) #2
eernst
LGTM, mentioning a couple of typos. https://codereview.chromium.org/2974763002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2974763002/diff/1/docs/language/dartLangSpec.tex#newcode6755 docs/language/dartLangSpec.tex:6755: a statment on ...
3 years, 5 months ago (2017-07-10 10:02:25 UTC) #3
Bob Nystrom
lgtm https://codereview.chromium.org/2974763002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2974763002/diff/1/docs/language/dartLangSpec.tex#newcode6773 docs/language/dartLangSpec.tex:6773: \rationale{Why is this a statement, not a built ...
3 years, 5 months ago (2017-07-10 14:42:26 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/2974763002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2974763002/diff/1/docs/language/dartLangSpec.tex#newcode6755 docs/language/dartLangSpec.tex:6755: a statment on the form \code{\ASSERT($e$, null);}. I try ...
3 years, 4 months ago (2017-08-07 11:57:00 UTC) #5
Lasse Reichstein Nielsen
PTAL eernst. I upped the version to 2.0.
3 years, 4 months ago (2017-08-07 13:37:38 UTC) #6
eernst
LGTM, noting one more typo. About the version number: It's far too tempting for the ...
3 years, 4 months ago (2017-08-07 14:06:39 UTC) #7
Lasse Reichstein Nielsen
Committed patchset #3 (id:40001) manually as e329e1ce29247512987434fd9a75bc518416d7ed (presubmit successful).
3 years, 4 months ago (2017-08-10 13:30:13 UTC) #10
Bob Nystrom
3 years, 4 months ago (2017-08-14 21:22:43 UTC) #11
Message was sent while issue was closed.
LGTM!

https://codereview.chromium.org/2974763002/diff/40001/docs/language/dartLangS...
File docs/language/dartLangSpec.tex (right):

https://codereview.chromium.org/2974763002/diff/40001/docs/language/dartLangS...
docs/language/dartLangSpec.tex:6767: An assertion on the form
\code{\ASSERT($e$))} is equivalent to an assertion on the form
\code{\ASSERT($e$, null)}.
"on" -> "of", in both places.

Powered by Google App Engine
This is Rietveld 408576698