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

Unified Diff: sky/specs/script.md

Issue 884713009: Specs: dartification of dom.md, more work on script.md; this is highly work-in-progress and hasn't … (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 5aa0f8c9726ef961f2f092467a0fd6cbc8f162b9..debe791d8e0963f8dde39b1ffd002984a4a5aa7e 100644
--- a/sky/specs/script.md
+++ b/sky/specs/script.md
@@ -1,15 +1,32 @@
Sky Script Language
===================
-The Sky script language is based on Dart.
+The Sky script language is Dart.
-It has the following differences from Dart:
+The way that Sky integrates the module system with its script language
+is described in [modules.md](modules.md).
-- the 'library', 'part', 'import', 'export', and 'part of' directives
- are not supported in sky (sky has its own module system)
+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:
-- ``<script>`` elements parse ``topLevelDefinition``s (there is no
- ``libraryDefinition`` construct in the Sky Script Language).
+ throw new ArgumentError(value, name: name);
-The way that Sky integrates the module system with its script language
-is described in [modules.md](modules.md).
+...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);
+
+The ``@nonnull`` annotation is defined as follows:
+
+```dart
+const nonnull = const Object();
+```
+
+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.
« 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