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

Unified Diff: sky/specs/script.md

Issue 924393004: Specs: strip @nonnull annotations since they're too verbose (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/specs/pointer.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/script.md
diff --git a/sky/specs/script.md b/sky/specs/script.md
index e7538eed87470f1be4d2c14bf14b7144351306b9..15c4dba252f571850777b766427bcc25d540d856 100644
--- a/sky/specs/script.md
+++ b/sky/specs/script.md
@@ -6,30 +6,18 @@ The Sky script language is Dart.
The way that Sky integrates the module system with its script language
is described in [modules.md](modules.md).
-When an method defined as ``external`` receives an argument, it must
-type-check it, and, if the argument's value is the wrong type, then it
-must throw an ArgumentError as follows:
+All the APIs defined in this documentation, unless explicitly called
+out as being in a framework, are in the `dart:sky` built-in module.
- throw new ArgumentError(value, name: name);
-
-...where "name" is the name of the argument.
-
-Further, if the type of the argument is annotated with ``@nonnull``,
-then the method must additionally throw if the value is of type Null,
-as follows:
-
- throw new ArgumentError.notNull(name);
+When a method in `dart:sky` defined as ``external`` receives an
+argument, it must type-check it, and, if the argument's value is the
+wrong type, then it must throw an ArgumentError as follows:
-The ``@nonnull`` annotation is defined as follows:
-
-```dart
-const nonnull = const Object();
-```
+ throw new ArgumentError(value, name: name);
-The ``@nonnull`` annotation does nothing in code not marked
-``external``, but it has been included anyway for documentation
-purposes. It indicates places where providing a null is a contract
-violation and that results are therefore likely to be poor.
+...where "name" is the name of the argument. Type checking here
+includes rejecting nulls unless otherwise indicated or unless null is
+argument's default value.
The following definitions are exposed in ``dart:sky``:
« no previous file with comments | « sky/specs/pointer.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698