OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library kernel.transformations.closure.mock; | 5 library kernel.transformations.closure.mock; |
6 | 6 |
7 import '../../ast.dart' | 7 import '../../ast.dart' |
8 show | 8 show |
9 Arguments, | 9 Arguments, |
10 Block, | 10 Block, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 List<Procedure> procedures = <Procedure>[indexGet, indexSet, copy]; | 193 List<Procedure> procedures = <Procedure>[indexGet, indexSet, copy]; |
194 | 194 |
195 Class contextClass = new Class( | 195 Class contextClass = new Class( |
196 name: "Context", | 196 name: "Context", |
197 supertype: new Supertype(coreTypes.objectClass, const <DartType>[]), | 197 supertype: new Supertype(coreTypes.objectClass, const <DartType>[]), |
198 constructors: [constructor], | 198 constructors: [constructor], |
199 fields: fields, | 199 fields: fields, |
200 procedures: procedures, | 200 procedures: procedures, |
201 fileUri: fileUri); | 201 fileUri: fileUri); |
202 Library mock = new Library(Uri.parse(fileUri), | 202 Library mock = |
203 name: "mock", classes: [contextClass])..fileUri = fileUri; | 203 new Library(Uri.parse(fileUri), name: "mock", classes: [contextClass]) |
| 204 ..fileUri = fileUri; |
204 program.libraries.add(mock); | 205 program.libraries.add(mock); |
205 mock.parent = program; | 206 mock.parent = program; |
206 program.uriToSource[mock.fileUri] = new Source(<int>[0], const <int>[]); | 207 program.uriToSource[mock.fileUri] = new Source(<int>[0], const <int>[]); |
207 return contextClass; | 208 return contextClass; |
208 } | 209 } |
OLD | NEW |