| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 var split; | 54 var split; |
| 55 var concat; | 55 var concat; |
| 56 var toString; | 56 var toString; |
| 57 } | 57 } |
| 58 class JSFunction {} | 58 class JSFunction {} |
| 59 class JSInt {} | 59 class JSInt {} |
| 60 class JSDouble {} | 60 class JSDouble {} |
| 61 class JSNumber {} | 61 class JSNumber {} |
| 62 class JSNull {} | 62 class JSNull {} |
| 63 class JSBool {} | 63 class JSBool {} |
| 64 var getInterceptor;"""; | 64 getInterceptor(o){} |
| 65 getDispatchProperty(o) {} |
| 66 setDispatchProperty(o, v) {}"""; |
| 65 } else if (uri.path.endsWith('js_helper.dart')) { | 67 } else if (uri.path.endsWith('js_helper.dart')) { |
| 66 source = 'library jshelper; class JSInvocationMirror {} ' | 68 source = 'library jshelper; class JSInvocationMirror {} ' |
| 67 'class ConstantMap {} class TypeImpl {}'; | 69 'class ConstantMap {} class TypeImpl {}'; |
| 68 } else if (uri.path.endsWith('isolate_helper.dart')) { | 70 } else if (uri.path.endsWith('isolate_helper.dart')) { |
| 69 source = 'library isolatehelper; class _WorkerStub {}'; | 71 source = 'library isolatehelper; class _WorkerStub {}'; |
| 70 } else { | 72 } else { |
| 71 source = "library lib;"; | 73 source = "library lib;"; |
| 72 } | 74 } |
| 73 } else { | 75 } else { |
| 74 throw "unexpected URI $uri"; | 76 throw "unexpected URI $uri"; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 92 new Uri.fromComponents(scheme: 'package', path: '/'), | 94 new Uri.fromComponents(scheme: 'package', path: '/'), |
| 93 provider, handler); | 95 provider, handler); |
| 94 result.then((String code) { | 96 result.then((String code) { |
| 95 if (code == null) { | 97 if (code == null) { |
| 96 throw 'Compilation failed'; | 98 throw 'Compilation failed'; |
| 97 } | 99 } |
| 98 }, onError: (AsyncError e) { | 100 }, onError: (AsyncError e) { |
| 99 throw 'Compilation failed'; | 101 throw 'Compilation failed'; |
| 100 }); | 102 }); |
| 101 } | 103 } |
| OLD | NEW |