| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 eqNullB(a) {} | 47 eqNullB(a) {} |
| 48 const proxy = 0;"""; | 48 const proxy = 0;"""; |
| 49 } else if (uri.path.endsWith('_patch.dart')) { | 49 } else if (uri.path.endsWith('_patch.dart')) { |
| 50 source = ''; | 50 source = ''; |
| 51 } else if (uri.path.endsWith('interceptors.dart')) { | 51 } else if (uri.path.endsWith('interceptors.dart')) { |
| 52 source = """ | 52 source = """ |
| 53 class Interceptor { | 53 class Interceptor { |
| 54 operator==(other) {} | 54 operator==(other) {} |
| 55 get hashCode => throw 'Interceptor.hashCode not implemented.'; | 55 get hashCode => throw 'Interceptor.hashCode not implemented.'; |
| 56 } | 56 } |
| 57 class JSIndexable { | 57 abstract class JSIndexable { |
| 58 get length {} | 58 get length; |
| 59 } | 59 } |
| 60 class JSMutableIndexable {} | 60 abstract class JSMutableIndexable {} |
| 61 class JSArray<E> implements JSIndexable { | 61 abstract class JSArray<E> implements JSIndexable { |
| 62 JSArray() {} | 62 JSArray() {} |
| 63 factory JSArray.typed(a) => a; | 63 factory JSArray.typed(a) => a; |
| 64 var removeLast; | 64 var removeLast; |
| 65 var add; | 65 var add; |
| 66 } | 66 } |
| 67 class JSMutableArray extends JSArray {} | 67 abstract class JSMutableArray extends JSArray {} |
| 68 class JSFixedArray extends JSMutableArray {} | 68 abstract class JSFixedArray extends JSMutableArray {} |
| 69 class JSExtendableArray extends JSMutableArray {} | 69 abstract class JSExtendableArray extends JSMutableArray {} |
| 70 class JSString implements JSIndexable { | 70 class JSString implements JSIndexable { |
| 71 var split; | 71 var split; |
| 72 var concat; | 72 var concat; |
| 73 operator+(other) {} | 73 operator+(other) {} |
| 74 var toString; | 74 var toString; |
| 75 get length => 0; |
| 75 } | 76 } |
| 76 class JSFunction {} | 77 class JSFunction {} |
| 77 class JSInt {} | 78 class JSInt {} |
| 78 class JSPositiveInt {} | 79 class JSPositiveInt {} |
| 79 class JSUInt31 {} | 80 class JSUInt31 {} |
| 80 class JSUInt32 {} | 81 class JSUInt32 {} |
| 81 class JSDouble {} | 82 class JSDouble {} |
| 82 class JSNumber {} | 83 class JSNumber {} |
| 83 class JSNull {} | 84 class JSNull {} |
| 84 class JSBool {} | 85 class JSBool {} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 new Uri(scheme: 'package', path: '/'), | 118 new Uri(scheme: 'package', path: '/'), |
| 118 provider, handler); | 119 provider, handler); |
| 119 result.then((String code) { | 120 result.then((String code) { |
| 120 if (code == null) { | 121 if (code == null) { |
| 121 throw 'Compilation failed'; | 122 throw 'Compilation failed'; |
| 122 } | 123 } |
| 123 }, onError: (e) { | 124 }, onError: (e) { |
| 124 throw 'Compilation failed'; | 125 throw 'Compilation failed'; |
| 125 }).then(asyncSuccess); | 126 }).then(asyncSuccess); |
| 126 } | 127 } |
| OLD | NEW |