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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 compile(new Uri(scheme: 'main'), | 109 compile(new Uri(scheme: 'main'), |
110 new Uri(scheme: 'lib', path: '/'), | 110 new Uri(scheme: 'lib', path: '/'), |
111 new Uri(scheme: 'package', path: '/'), | 111 new Uri(scheme: 'package', path: '/'), |
112 provider, handler); | 112 provider, handler); |
113 result.then((String code) { | 113 result.then((String code) { |
114 if (code == null) { | 114 if (code == null) { |
115 throw 'Compilation failed'; | 115 throw 'Compilation failed'; |
116 } | 116 } |
117 }, onError: (e) { | 117 }, onError: (e) { |
118 throw 'Compilation failed'; | 118 throw 'Compilation failed'; |
119 }).whenComplete(() => asyncEnd()); | 119 }).then(asyncSuccess); |
120 } | 120 } |
OLD | NEW |