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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 SourceFile sourceFile = new SourceFile(uri.toString(), text); | 54 SourceFile sourceFile = new SourceFile(uri.toString(), text); |
55 return new leg.Script(uri, sourceFile); | 55 return new leg.Script(uri, sourceFile); |
56 } | 56 } |
57 | 57 |
58 translateDartUri(Uri uri, tree.ScriptTag node) { | 58 translateDartUri(Uri uri, tree.ScriptTag node) { |
59 String path = DART2JS_LIBRARY_MAP[uri.path]; | 59 String path = DART2JS_LIBRARY_MAP[uri.path]; |
60 if (path === null || uri.path.startsWith('_')) { | 60 if (path === null || uri.path.startsWith('_')) { |
61 reportError(node, 'library not found ${uri}'); | 61 reportError(node, 'library not found ${uri}'); |
62 return null; | 62 return null; |
63 } | 63 } |
64 if (uri.path == 'dom' || uri.path == 'html' || uri.path == 'io') { | 64 if (uri.path == 'dom_deprecated' |
| 65 || uri.path == 'html' || uri.path == 'io') { |
65 // TODO(ahe): Get rid of mockableLibraryUsed when test.dart | 66 // TODO(ahe): Get rid of mockableLibraryUsed when test.dart |
66 // supports this use case better. | 67 // supports this use case better. |
67 mockableLibraryUsed = true; | 68 mockableLibraryUsed = true; |
68 } | 69 } |
69 return libraryRoot.resolve(path); | 70 return libraryRoot.resolve(path); |
70 } | 71 } |
71 | 72 |
72 translatePackageUri(Uri uri, tree.ScriptTag node) => | 73 translatePackageUri(Uri uri, tree.ScriptTag node) => |
73 packageRoot.resolve(uri.path); | 74 packageRoot.resolve(uri.path); |
74 | 75 |
(...skipping 16 matching lines...) Expand all Loading... |
91 } else { | 92 } else { |
92 handler(span.uri, span.begin, span.end, message, fatal); | 93 handler(span.uri, span.begin, span.end, message, fatal); |
93 } | 94 } |
94 } | 95 } |
95 | 96 |
96 bool get isMockCompilation() { | 97 bool get isMockCompilation() { |
97 return mockableLibraryUsed | 98 return mockableLibraryUsed |
98 && (options.indexOf('--allow-mock-compilation') !== -1); | 99 && (options.indexOf('--allow-mock-compilation') !== -1); |
99 } | 100 } |
100 } | 101 } |
OLD | NEW |