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:async'; | 8 import 'dart:async'; |
9 import 'dart:collection'; | 9 import 'dart:collection'; |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 toString() {} | 95 toString() {} |
96 bool operator==(other) => identical(this, other); | 96 bool operator==(other) => identical(this, other); |
97 get hashCode => throw "Interceptor.hashCode not implemented."; | 97 get hashCode => throw "Interceptor.hashCode not implemented."; |
98 noSuchMethod(im) { throw im; } | 98 noSuchMethod(im) { throw im; } |
99 } | 99 } |
100 abstract class JSIndexable { | 100 abstract class JSIndexable { |
101 get length; | 101 get length; |
102 operator[](index); | 102 operator[](index); |
103 } | 103 } |
104 abstract class JSMutableIndexable extends JSIndexable {} | 104 abstract class JSMutableIndexable extends JSIndexable {} |
105 class JSArray<E> extends Interceptor implements List<E>, JSIndexable { | 105 class JSArray extends Interceptor implements List, JSIndexable { |
106 JSArray(); | |
107 factory JSArray.typed(a) => a; | |
108 var length; | 106 var length; |
109 operator[](index) => this[index]; | 107 operator[](index) => this[index]; |
110 operator[]=(index, value) { this[index] = value; } | 108 operator[]=(index, value) { this[index] = value; } |
111 add(value) { this[length + 1] = value; } | 109 add(value) { this[length + 1] = value; } |
112 removeAt(index) {} | 110 removeAt(index) {} |
113 insert(index, value) {} | 111 insert(index, value) {} |
114 removeLast() {} | 112 removeLast() {} |
115 } | 113 } |
116 class JSMutableArray extends JSArray implements JSMutableIndexable {} | 114 class JSMutableArray extends JSArray implements JSMutableIndexable {} |
117 class JSFixedArray extends JSMutableArray {} | 115 class JSFixedArray extends JSMutableArray {} |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } else { | 504 } else { |
507 sourceFile = compiler.sourceFiles[uri.toString()]; | 505 sourceFile = compiler.sourceFiles[uri.toString()]; |
508 } | 506 } |
509 if (sourceFile != null && begin != null && end != null) { | 507 if (sourceFile != null && begin != null && end != null) { |
510 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 508 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
511 } else { | 509 } else { |
512 print(message); | 510 print(message); |
513 } | 511 } |
514 }; | 512 }; |
515 } | 513 } |
OLD | NEW |