| OLD | NEW |
| 1 Sky Script Language | 1 Sky Script Language |
| 2 =================== | 2 =================== |
| 3 | 3 |
| 4 The Sky script language is based on Dart. | 4 The Sky script language is Dart. |
| 5 | |
| 6 It has the following differences from Dart: | |
| 7 | |
| 8 - the 'library', 'part', 'import', 'export', and 'part of' directives | |
| 9 are not supported in sky (sky has its own module system) | |
| 10 | |
| 11 - ``<script>`` elements parse ``topLevelDefinition``s (there is no | |
| 12 ``libraryDefinition`` construct in the Sky Script Language). | |
| 13 | 5 |
| 14 The way that Sky integrates the module system with its script language | 6 The way that Sky integrates the module system with its script language |
| 15 is described in [modules.md](modules.md). | 7 is described in [modules.md](modules.md). |
| 8 |
| 9 When an method defined as ``external`` receives an argument, it must |
| 10 type-check it, and, if the argument's value is the wrong type, then it |
| 11 must throw an ArgumentError as follows: |
| 12 |
| 13 throw new ArgumentError(value, name: name); |
| 14 |
| 15 ...where "name" is the name of the argument. |
| 16 |
| 17 Further, if the type of the argument is annotated with ``@nonnull``, |
| 18 then the method must additionally throw if the value is of type Null, |
| 19 as follows: |
| 20 |
| 21 throw new ArgumentError.notNull(name); |
| 22 |
| 23 The ``@nonnull`` annotation is defined as follows: |
| 24 |
| 25 ```dart |
| 26 const nonnull = const Object(); |
| 27 ``` |
| 28 |
| 29 The ``@nonnull`` annotation does nothing in code not marked |
| 30 ``external``, but it has been included anyway for documentation |
| 31 purposes. It indicates places where providing a null is a contract |
| 32 violation and that results are therefore likely to be poor. |
| OLD | NEW |