| 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('leg_apiimpl'); | 5 #library('leg_apiimpl'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../compiler.dart', prefix: 'api'); | 9 #import('../compiler.dart', prefix: 'api'); |
| 10 #import('leg.dart', prefix: 'leg'); | 10 #import('leg.dart', prefix: 'leg'); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 default: return uri; | 99 default: return uri; |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 Uri translateDartUri(Uri uri, tree.Node node) { | 103 Uri translateDartUri(Uri uri, tree.Node node) { |
| 104 String path = lookupLibraryPath(uri.path); | 104 String path = lookupLibraryPath(uri.path); |
| 105 if (path === null || LIBRARIES[uri.path].category == "Internal") { | 105 if (path === null || LIBRARIES[uri.path].category == "Internal") { |
| 106 reportError(node, 'library not found ${uri}'); | 106 reportError(node, 'library not found ${uri}'); |
| 107 return null; | 107 return null; |
| 108 } | 108 } |
| 109 if (uri.path == 'dom_deprecated' || | 109 if (uri.path == 'html' || |
| 110 uri.path == 'html' || | |
| 111 uri.path == 'io') { | 110 uri.path == 'io') { |
| 112 // TODO(ahe): Get rid of mockableLibraryUsed when test.dart | 111 // TODO(ahe): Get rid of mockableLibraryUsed when test.dart |
| 113 // supports this use case better. | 112 // supports this use case better. |
| 114 mockableLibraryUsed = true; | 113 mockableLibraryUsed = true; |
| 115 } | 114 } |
| 116 return libraryRoot.resolve(path); | 115 return libraryRoot.resolve(path); |
| 117 } | 116 } |
| 118 | 117 |
| 119 Uri resolvePatchUri(String dartLibraryPath) { | 118 Uri resolvePatchUri(String dartLibraryPath) { |
| 120 String patchPath = lookupPatchPath(dartLibraryPath); | 119 String patchPath = lookupPatchPath(dartLibraryPath); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 145 handler(translateUri(span.uri, null), span.begin, span.end, | 144 handler(translateUri(span.uri, null), span.begin, span.end, |
| 146 message, kind); | 145 message, kind); |
| 147 } | 146 } |
| 148 } | 147 } |
| 149 | 148 |
| 150 bool get isMockCompilation { | 149 bool get isMockCompilation { |
| 151 return mockableLibraryUsed | 150 return mockableLibraryUsed |
| 152 && (options.indexOf('--allow-mock-compilation') !== -1); | 151 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 153 } | 152 } |
| 154 } | 153 } |
| OLD | NEW |