| OLD | NEW |
| 1 Sky Script Language | 1 Sky Script Language |
| 2 =================== | 2 =================== |
| 3 | 3 |
| 4 The Sky script language is Dart. | 4 The Sky script language is Dart. |
| 5 | 5 |
| 6 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 |
| 7 is described in [modules.md](modules.md). | 7 is described in [modules.md](modules.md). |
| 8 | 8 |
| 9 All the APIs defined in this documentation, unless explicitly called | 9 All the APIs defined in this documentation, unless explicitly called |
| 10 out as being in a framework, are in the `dart:sky` built-in module. | 10 out as being in a framework, are in the `dart:sky` built-in module. |
| 11 | 11 |
| 12 When a method in `dart:sky` defined as ``external`` receives an | 12 When a method in `dart:sky` defined as ``external`` receives an |
| 13 argument, it must type-check it, and, if the argument's value is the | 13 argument, it must type-check it, and, if the argument's value is the |
| 14 wrong type, then it must throw an ArgumentError as follows: | 14 wrong type, then it must throw an ArgumentError as follows: |
| 15 | 15 |
| 16 throw new ArgumentError(value, name: name); | 16 throw new ArgumentError(value, name: name); |
| 17 | 17 |
| 18 ...where "name" is the name of the argument. Type checking here | 18 ...where "name" is the name of the argument. Type checking here |
| 19 includes rejecting nulls unless otherwise indicated or unless null is | 19 includes rejecting nulls unless otherwise indicated or unless null is |
| 20 argument's default value. | 20 argument's default value. |
| 21 | 21 |
| 22 The following definitions are exposed in ``dart:sky``: | 22 The following definitions are exposed in ``dart:sky``: |
| 23 | 23 |
| 24 ```dart | 24 ```dart |
| 25 import 'dart:mirrors'; |
| 26 |
| 25 abstract class AutomaticMetadata { | 27 abstract class AutomaticMetadata { |
| 26 const AutomaticMetadata(); | 28 const AutomaticMetadata(); |
| 27 void init(DeclarationMirror target, Module module); | 29 void init(DeclarationMirror target, Module module); |
| 28 | 30 |
| 29 static void runLibrary(LibraryMirror library, Module module) { | 31 static void runLibrary(LibraryMirror library, Module module) { |
| 30 library.declarations.values.toList() /* ..sort((DeclarationMirror a, Declara
tionMirror b) { | 32 library.declarations.values.toList() /* ..sort((DeclarationMirror a, Declara
tionMirror b) { |
| 31 bool aHasLocation; | 33 bool aHasLocation; |
| 32 try { | 34 try { |
| 33 aHasLocation = a.location != null; | 35 aHasLocation = a.location != null; |
| 34 } catch(e) { | 36 } catch(e) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 syntax for defining this is, within the class body for a class | 91 syntax for defining this is, within the class body for a class |
| 90 called ClassName: | 92 called ClassName: |
| 91 | 93 |
| 92 ```dart | 94 ```dart |
| 93 ClassName = SuperclassName; | 95 ClassName = SuperclassName; |
| 94 ClassName.namedConstructor = SuperclassName.otherNamedConstructor; | 96 ClassName.namedConstructor = SuperclassName.otherNamedConstructor; |
| 95 ``` | 97 ``` |
| 96 | 98 |
| 97 * The reflection APIs (`dart:mirrors`) are assumed to reflect a | 99 * The reflection APIs (`dart:mirrors`) are assumed to reflect a |
| 98 library's declarations in source order. | 100 library's declarations in source order. |
| OLD | NEW |