| 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("../../../../lib/uri/uri.dart"); | 7 #import("../../../../lib/uri/uri.dart"); |
| 8 | 8 |
| 9 #import("../../../leg/elements/elements.dart"); | 9 #import("../../../leg/elements/elements.dart"); |
| 10 #import("../../../leg/io/io.dart", prefix: 'io'); | 10 #import("../../../leg/io/io.dart", prefix: 'io'); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 super.withCurrentDirectory(io.getCurrentDirectory()) { | 60 super.withCurrentDirectory(io.getCurrentDirectory()) { |
| 61 Uri uri = new Uri(scheme: "source"); | 61 Uri uri = new Uri(scheme: "source"); |
| 62 var script = new Script(uri, new MockFile(coreSource)); | 62 var script = new Script(uri, new MockFile(coreSource)); |
| 63 coreLibrary = new LibraryElement(script); | 63 coreLibrary = new LibraryElement(script); |
| 64 parseScript(coreSource, coreLibrary); | 64 parseScript(coreSource, coreLibrary); |
| 65 script = new Script(uri, new MockFile(helperSource)); | 65 script = new Script(uri, new MockFile(helperSource)); |
| 66 jsHelperLibrary = new LibraryElement(script); | 66 jsHelperLibrary = new LibraryElement(script); |
| 67 parseScript(helperSource, jsHelperLibrary); | 67 parseScript(helperSource, jsHelperLibrary); |
| 68 scanner.importLibrary(jsHelperLibrary, coreLibrary, null); | 68 scanner.importLibrary(jsHelperLibrary, coreLibrary, null); |
| 69 mainApp = mockLibrary(this, ""); | 69 mainApp = mockLibrary(this, ""); |
| 70 objectClass = coreLibrary.find(Compiler.OBJECT); | 70 initializeSpecialClasses(); |
| 71 closureClass = jsHelperLibrary.find(Compiler.CLOSURE); | |
| 72 } | 71 } |
| 73 | 72 |
| 74 void reportWarning(Node node, var message) { | 73 void reportWarning(Node node, var message) { |
| 75 warnings.add(new WarningMessage(node, message.message)); | 74 warnings.add(new WarningMessage(node, message.message)); |
| 76 } | 75 } |
| 77 | 76 |
| 78 void reportError(Node node, var message) { | 77 void reportError(Node node, var message) { |
| 79 errors.add(new WarningMessage(node, message.message)); | 78 errors.add(new WarningMessage(node, message.message)); |
| 80 } | 79 } |
| 81 | 80 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 importLibrary(library, compiler.coreLibrary, compiler); | 183 importLibrary(library, compiler.coreLibrary, compiler); |
| 185 return library; | 184 return library; |
| 186 } | 185 } |
| 187 | 186 |
| 188 class StringScript extends Script { | 187 class StringScript extends Script { |
| 189 final String code; | 188 final String code; |
| 190 StringScript(this.code) : super(null, null); | 189 StringScript(this.code) : super(null, null); |
| 191 String get text() => code; | 190 String get text() => code; |
| 192 String get name() => "mock script"; | 191 String get name() => "mock script"; |
| 193 } | 192 } |
| OLD | NEW |