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

Unified Diff: docs/language/dartLangSpec.tex

Issue 2979523002: The actual change to the wording of `assert` that I intended in the previous CL. (Closed)
Patch Set: Fix the wording. Negations matter. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/language/dartLangSpec.tex
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index d717980b38f336159330eef7bb8e4abc0a2c5324..22c6377da57d9f19d8bedddcd9f3f0786e569667 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -6737,7 +6737,7 @@ It is a compile-time error if a yield-each statement appears in a function that
Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function. It is a static type warning if $T$ may not be assigned to the declared return type of $f$. If $f$ is synchronous it is a static type warning if $T$ may not be assigned to \code{Iterable}. If $f$ is asynchronous it is a static type warning if $T$ may not be assigned to \code{Stream}.
-\subsection{ Assert}
+\subsection{Assert}
\LMLabel{assert}
\LMHash{}
@@ -6774,17 +6774,13 @@ execution of an assertion \code{\ASSERT{}($c$, $e$)} proceeds as follows:
\LMHash{}
The expression $c$ is evaluated to an object $o$.
-If the class of $o$ is not a subtype of \code{Function} then
-let $r$ be $o$.
-Otherwise,
-if the assertion occurs in the initializer list of a \CONST{} constructor,
-then we say that the assertion failed,
-otherwise let $r$ be the result of invoking $o$ with no arguments.
-It is a dynamic type error if $o$ is not of type \code{bool} or of type \code{Function}, or if $r$ is not of type \code{bool}.
-If $r$ is \FALSE{}, we say that the assertion failed.
-If $r$ is \TRUE{}, we say that the assertion succeeded.
-If the assertion succeeded, execution of the assert statement completes normally (\ref{completion}).
-If the assertion failed, $e$ is evaluated to an object $m$.
+If the class of $o$ is a subtype of \code{Function}
+and the assertion does not occur in the initializer list of a \CONST{} constructor,
+then let $r$ be the result of invoking $o$ with no arguments.
+Otherwise let $r$ be $o$.
+It is a dynamic type error if $r$ is not of type \code{bool}.
eernst 2017/07/10 14:04:54 `\commentary{Hence, it is a compile-time error if
Lasse Reichstein Nielsen 2017/07/11 09:51:48 Done.
+If $r$ is \TRUE{}, execution of the assert statement completes normally (\ref{completion}).
+Otherwise, $e$ is evaluated to an object $m$.
eernst 2017/07/10 14:04:54 It's probably easier for the reader to get this ri
Lasse Reichstein Nielsen 2017/07/11 09:51:48 I don't feel confident using a semicolon like that
Then the execution of the assert statement throws (\ref{completion}) an \code{AssertionError} containing $m$ and with a stack trace corresponding to the current execution state at the \ASSERT{} statement.
\LMHash{}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698