| 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 // Smoke test of the dart2js compiler API. | 5 // Smoke test of the dart2js compiler API. |
| 6 library dummy_compiler; | 6 library dummy_compiler; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:uri'; | 9 import 'dart:uri'; |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 class Dynamic_ {} | 32 class Dynamic_ {} |
| 33 class Null {} | 33 class Null {} |
| 34 getRuntimeTypeInfo(o) {} | 34 getRuntimeTypeInfo(o) {} |
| 35 setRuntimeTypeInfo(o, i) {} | 35 setRuntimeTypeInfo(o, i) {} |
| 36 eqNull(a) {} | 36 eqNull(a) {} |
| 37 eqNullB(a) {}"""; | 37 eqNullB(a) {}"""; |
| 38 } else if (uri.path.endsWith('_patch.dart')) { | 38 } else if (uri.path.endsWith('_patch.dart')) { |
| 39 source = ''; | 39 source = ''; |
| 40 } else if (uri.path.endsWith('interceptors.dart')) { | 40 } else if (uri.path.endsWith('interceptors.dart')) { |
| 41 source = """class ObjectInterceptor {} | 41 source = """class ObjectInterceptor {} |
| 42 class JSArray {} | 42 class JSArray { |
| 43 class JSString {} | 43 var length; |
| 44 var removeLast; |
| 45 var add; |
| 46 } |
| 47 class JSString { |
| 48 var length; |
| 49 var split; |
| 50 var concat; |
| 51 } |
| 44 class JSFunction {} | 52 class JSFunction {} |
| 45 class JSInt {} | 53 class JSInt {} |
| 46 class JSDouble {} | 54 class JSDouble {} |
| 47 class JSNumber {} | 55 class JSNumber {} |
| 48 class JSNull {} | 56 class JSNull {} |
| 49 class JSBool {} | 57 class JSBool {} |
| 50 var getInterceptor;"""; | 58 var getInterceptor;"""; |
| 51 } else if (uri.path.endsWith('js_helper.dart')) { | 59 } else if (uri.path.endsWith('js_helper.dart')) { |
| 52 source = 'library jshelper; class JSInvocationMirror {}'; | 60 source = 'library jshelper; class JSInvocationMirror {}'; |
| 53 } else if (uri.path.endsWith('isolate_helper.dart')) { | 61 } else if (uri.path.endsWith('isolate_helper.dart')) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 | 80 |
| 73 main() { | 81 main() { |
| 74 String code = compile(new Uri.fromComponents(scheme: 'main'), | 82 String code = compile(new Uri.fromComponents(scheme: 'main'), |
| 75 new Uri.fromComponents(scheme: 'lib', path: '/'), | 83 new Uri.fromComponents(scheme: 'lib', path: '/'), |
| 76 new Uri.fromComponents(scheme: 'package', path: '/'), | 84 new Uri.fromComponents(scheme: 'package', path: '/'), |
| 77 provider, handler).value; | 85 provider, handler).value; |
| 78 if (code == null) { | 86 if (code == null) { |
| 79 throw 'Compilation failed'; | 87 throw 'Compilation failed'; |
| 80 } | 88 } |
| 81 } | 89 } |
| OLD | NEW |