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

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: Address comments. 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..347f5ecb6bf74c4bf294198d18f5552dd669a58f 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,18 +6774,15 @@ 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$.
-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.
+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}.
+\commentary{Hence it is a compile-time error if that situation arises during evaluation of an assertion in a \CONST{} constructor invocation.}
+If $r$ is \TRUE{}, execution of the assert statement completes normally (\ref{completion}).
+Otherwise, $e$ is evaluated to an object $m$
+and 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{}
It is a static type warning if the type of $e$ may not be assigned to either
« 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