Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 operator &(other) => 42; | 144 operator &(other) => 42; |
| 145 operator ^(other) => 42; | 145 operator ^(other) => 42; |
| 146 | 146 |
| 147 operator >(other) => true; | 147 operator >(other) => true; |
| 148 operator >=(other) => true; | 148 operator >=(other) => true; |
| 149 operator <(other) => true; | 149 operator <(other) => true; |
| 150 operator <=(other) => true; | 150 operator <=(other) => true; |
| 151 operator ==(other) => true; | 151 operator ==(other) => true; |
| 152 get hashCode => throw "JSNumber.hashCode not implemented."; | 152 get hashCode => throw "JSNumber.hashCode not implemented."; |
| 153 | 153 |
| 154 _tdivFast(other) => 42; | 154 // Force side effects on _tdivFast to ensure the optimizers do the |
| 155 // right thing. | |
|
sra1
2013/12/11 09:45:24
I'm not sure 'do the right thing' is what we reall
ngeoffray
2013/12/16 13:31:41
No, that's correct. I improved the comment.
| |
| 156 _tdivFast(other) => new List()..length = 42; | |
| 155 _shlPositive(other) => 42; | 157 _shlPositive(other) => 42; |
| 156 _shrBothPositive(other) => 42; | 158 _shrBothPositive(other) => 42; |
| 157 _shrReceiverPositive(other) => 42; | 159 _shrReceiverPositive(other) => 42; |
| 158 _shrOtherPositive(other) => 42; | 160 _shrOtherPositive(other) => 42; |
| 159 | 161 |
| 160 abs() => (this is JSInt) ? 42 : 42.2; | 162 abs() => (this is JSInt) ? 42 : 42.2; |
| 161 remainder(other) => (this is JSInt) ? 42 : 42.2; | 163 remainder(other) => (this is JSInt) ? 42 : 42.2; |
| 162 truncate() => 42; | 164 truncate() => 42; |
| 163 } | 165 } |
| 164 class JSInt extends JSNumber implements int { | 166 class JSInt extends JSNumber implements int { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 558 } else { | 560 } else { |
| 559 sourceFile = compiler.sourceFiles[uri.toString()]; | 561 sourceFile = compiler.sourceFiles[uri.toString()]; |
| 560 } | 562 } |
| 561 if (sourceFile != null && begin != null && end != null) { | 563 if (sourceFile != null && begin != null && end != null) { |
| 562 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 564 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
| 563 } else { | 565 } else { |
| 564 print(message); | 566 print(message); |
| 565 } | 567 } |
| 566 }; | 568 }; |
| 567 } | 569 } |
| OLD | NEW |