| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 mock_compiler; | 5 library mock_compiler; |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 | 10 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // We need to set the assert method to avoid calls with a 'null' | 243 // We need to set the assert method to avoid calls with a 'null' |
| 244 // target being interpreted as a call to assert. | 244 // target being interpreted as a call to assert. |
| 245 jsHelperLibrary = createLibrary("helper", helperSource); | 245 jsHelperLibrary = createLibrary("helper", helperSource); |
| 246 foreignLibrary = createLibrary("foreign", FOREIGN_LIBRARY); | 246 foreignLibrary = createLibrary("foreign", FOREIGN_LIBRARY); |
| 247 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); | 247 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); |
| 248 isolateHelperLibrary = createLibrary("isolate_helper", isolateHelperSource); | 248 isolateHelperLibrary = createLibrary("isolate_helper", isolateHelperSource); |
| 249 | 249 |
| 250 // Set up the library imports. | 250 // Set up the library imports. |
| 251 importHelperLibrary(coreLibrary); | 251 importHelperLibrary(coreLibrary); |
| 252 libraryLoader.importLibrary(jsHelperLibrary, coreLibrary, null); | 252 libraryLoader.importLibrary(jsHelperLibrary, coreLibrary, null); |
| 253 libraryLoader.importLibrary(foreignLibrary, coreLibrary, null); |
| 253 libraryLoader.importLibrary(interceptorsLibrary, coreLibrary, null); | 254 libraryLoader.importLibrary(interceptorsLibrary, coreLibrary, null); |
| 254 libraryLoader.importLibrary(isolateHelperLibrary, coreLibrary, null); | 255 libraryLoader.importLibrary(isolateHelperLibrary, coreLibrary, null); |
| 255 | 256 |
| 256 assertMethod = jsHelperLibrary.find(buildSourceString('assertHelper')); | 257 assertMethod = jsHelperLibrary.find(buildSourceString('assertHelper')); |
| 257 identicalFunction = coreLibrary.find(buildSourceString('identical')); | 258 identicalFunction = coreLibrary.find(buildSourceString('identical')); |
| 258 | 259 |
| 259 mainApp = mockLibrary(this, ""); | 260 mainApp = mockLibrary(this, ""); |
| 260 initializeSpecialClasses(); | 261 initializeSpecialClasses(); |
| 261 // We need to make sure the Object class is resolved. When registering a | 262 // We need to make sure the Object class is resolved. When registering a |
| 262 // dynamic invocation the ArgumentTypesRegistry eventually iterates over | 263 // dynamic invocation the ArgumentTypesRegistry eventually iterates over |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 } else { | 480 } else { |
| 480 sourceFile = compiler.sourceFiles[uri.toString()]; | 481 sourceFile = compiler.sourceFiles[uri.toString()]; |
| 481 } | 482 } |
| 482 if (sourceFile != null && begin != null && end != null) { | 483 if (sourceFile != null && begin != null && end != null) { |
| 483 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 484 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
| 484 } else { | 485 } else { |
| 485 print(message); | 486 print(message); |
| 486 } | 487 } |
| 487 }; | 488 }; |
| 488 } | 489 } |
| OLD | NEW |