| 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 library mock_compiler; | 5 library mock_compiler; |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:uri'; | 9 import 'dart:uri'; |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 const String DEFAULT_INTERCEPTORSLIB = r''' | 75 const String DEFAULT_INTERCEPTORSLIB = r''' |
| 76 class Interceptor { | 76 class Interceptor { |
| 77 toString() {} | 77 toString() {} |
| 78 bool operator==(other) => identical(this, other); | 78 bool operator==(other) => identical(this, other); |
| 79 noSuchMethod(im) { throw im; } | 79 noSuchMethod(im) { throw im; } |
| 80 } | 80 } |
| 81 abstract class JSIndexable { | 81 abstract class JSIndexable { |
| 82 get length; | 82 get length; |
| 83 } | 83 } |
| 84 abstract class JSMutableIndexable extends JSIndexable {} |
| 84 class JSArray extends Interceptor implements List, JSIndexable { | 85 class JSArray extends Interceptor implements List, JSIndexable { |
| 85 var length; | 86 var length; |
| 86 operator[](index) {} | 87 operator[](index) {} |
| 87 operator[]=(index, value) {} | 88 operator[]=(index, value) {} |
| 88 var add; | 89 var add; |
| 89 } | 90 } |
| 90 class JSMutableArray extends JSArray {} | 91 class JSMutableArray extends JSArray implements JSMutableIndexable {} |
| 91 class JSFixedArray extends JSMutableArray {} | 92 class JSFixedArray extends JSMutableArray {} |
| 92 class JSExtendableArray extends JSMutableArray {} | 93 class JSExtendableArray extends JSMutableArray {} |
| 93 class JSString extends Interceptor implements String, JSIndexable { | 94 class JSString extends Interceptor implements String, JSIndexable { |
| 94 var length; | 95 var length; |
| 95 operator[](index) {} | 96 operator[](index) {} |
| 96 toString() {} | 97 toString() {} |
| 97 } | 98 } |
| 98 class JSNumber extends Interceptor implements num { | 99 class JSNumber extends Interceptor implements num { |
| 99 // All these methods return a number to please type inferencing. | 100 // All these methods return a number to please type inferencing. |
| 100 operator-() => (this is JSInt) ? 42 : 42.0; | 101 operator-() => (this is JSInt) ? 42 : 42.0; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 401 } |
| 401 } | 402 } |
| 402 | 403 |
| 403 class MockDeferredLoadTask extends DeferredLoadTask { | 404 class MockDeferredLoadTask extends DeferredLoadTask { |
| 404 MockDeferredLoadTask(Compiler compiler) : super(compiler); | 405 MockDeferredLoadTask(Compiler compiler) : super(compiler); |
| 405 | 406 |
| 406 void registerMainApp(LibraryElement mainApp) { | 407 void registerMainApp(LibraryElement mainApp) { |
| 407 // Do nothing. | 408 // Do nothing. |
| 408 } | 409 } |
| 409 } | 410 } |
| OLD | NEW |