| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 class JSMutableArray extends JSArray implements JSMutableIndexable {} | 116 class JSMutableArray extends JSArray implements JSMutableIndexable {} |
| 117 class JSFixedArray extends JSMutableArray {} | 117 class JSFixedArray extends JSMutableArray {} |
| 118 class JSExtendableArray extends JSMutableArray {} | 118 class JSExtendableArray extends JSMutableArray {} |
| 119 class JSString extends Interceptor implements String, JSIndexable { | 119 class JSString extends Interceptor implements String, JSIndexable { |
| 120 var length; | 120 var length; |
| 121 operator[](index) {} | 121 operator[](index) {} |
| 122 toString() {} | 122 toString() {} |
| 123 operator+(other) => this; | 123 operator+(other) => this; |
| 124 } | 124 } |
| 125 class JSUInt32 extends JSInt {} |
| 126 class JSUInt31 extends JSUInt32 {} |
| 125 class JSNumber extends Interceptor implements num { | 127 class JSNumber extends Interceptor implements num { |
| 126 // All these methods return a number to please type inferencing. | 128 // All these methods return a number to please type inferencing. |
| 127 operator-() => (this is JSInt) ? 42 : 42.2; | 129 operator-() => (this is JSInt) ? 42 : 42.2; |
| 128 operator +(other) => (this is JSInt) ? 42 : 42.2; | 130 operator +(other) => (this is JSInt) ? 42 : 42.2; |
| 129 operator -(other) => (this is JSInt) ? 42 : 42.2; | 131 operator -(other) => (this is JSInt) ? 42 : 42.2; |
| 130 operator ~/(other) => 42; | 132 operator ~/(other) => 42; |
| 131 operator /(other) => (this is JSInt) ? 42 : 42.2; | 133 operator /(other) => (this is JSInt) ? 42 : 42.2; |
| 132 operator *(other) => (this is JSInt) ? 42 : 42.2; | 134 operator *(other) => (this is JSInt) ? 42 : 42.2; |
| 133 operator %(other) => (this is JSInt) ? 42 : 42.2; | 135 operator %(other) => (this is JSInt) ? 42 : 42.2; |
| 134 operator <<(other) => 42; | 136 operator <<(other) => 42; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 } else { | 508 } else { |
| 507 sourceFile = compiler.sourceFiles[uri.toString()]; | 509 sourceFile = compiler.sourceFiles[uri.toString()]; |
| 508 } | 510 } |
| 509 if (sourceFile != null && begin != null && end != null) { | 511 if (sourceFile != null && begin != null && end != null) { |
| 510 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 512 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
| 511 } else { | 513 } else { |
| 512 print(message); | 514 print(message); |
| 513 } | 515 } |
| 514 }; | 516 }; |
| 515 } | 517 } |
| OLD | NEW |