| 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 // VMOptions= | 4 // VMOptions= |
| 5 // VMOptions=--print-object-histogram | 5 // VMOptions=--print-object-histogram |
| 6 | 6 |
| 7 // Smoke test of the dart2js compiler API. | 7 // Smoke test of the dart2js compiler API. |
| 8 library dummy_compiler; | 8 library dummy_compiler; |
| 9 | 9 |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 getDispatchProperty(o) {} | 93 getDispatchProperty(o) {} |
| 94 setDispatchProperty(o, v) {} | 94 setDispatchProperty(o, v) {} |
| 95 var mapTypeToInterceptor;"""; | 95 var mapTypeToInterceptor;"""; |
| 96 } else if (uri.path.endsWith('js_helper.dart')) { | 96 } else if (uri.path.endsWith('js_helper.dart')) { |
| 97 return """ | 97 return """ |
| 98 library jshelper; class JSInvocationMirror {} | 98 library jshelper; class JSInvocationMirror {} |
| 99 class ConstantMap {} class TypeImpl {} | 99 class ConstantMap {} class TypeImpl {} |
| 100 createRuntimeType(String name) => null; | 100 createRuntimeType(String name) => null; |
| 101 class Closure {} | 101 class Closure {} |
| 102 class BoundClosure extends Closure {} | 102 class BoundClosure extends Closure {} |
| 103 const patch = 0; |
| 103 """; | 104 """; |
| 104 } else if (uri.path.endsWith('isolate_helper.dart')) { | 105 } else if (uri.path.endsWith('isolate_helper.dart')) { |
| 105 return 'library isolatehelper; class _WorkerStub {}'; | 106 return 'library isolatehelper; class _WorkerStub {}'; |
| 106 } else { | 107 } else { |
| 107 return "library lib${uri.path.replaceAll('/', '.')};"; | 108 return "library lib${uri.path.replaceAll('/', '.')};"; |
| 108 } | 109 } |
| 109 } | 110 } |
| 110 | 111 |
| 111 Future<String> provider(Uri uri) { | 112 Future<String> provider(Uri uri) { |
| 112 String source; | 113 String source; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 136 new Uri(scheme: 'package', path: '/'), | 137 new Uri(scheme: 'package', path: '/'), |
| 137 provider, handler); | 138 provider, handler); |
| 138 result.then((String code) { | 139 result.then((String code) { |
| 139 if (code == null) { | 140 if (code == null) { |
| 140 throw 'Compilation failed'; | 141 throw 'Compilation failed'; |
| 141 } | 142 } |
| 142 }, onError: (e) { | 143 }, onError: (e) { |
| 143 throw 'Compilation failed'; | 144 throw 'Compilation failed'; |
| 144 }).then(asyncSuccess); | 145 }).then(asyncSuccess); |
| 145 } | 146 } |
| OLD | NEW |