Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 111553003: Fix regression on side effects of tdiv. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 // We force side effects on _tdivFast to mimic the shortcomings of
155 // the effect analysis: because the `_tdivFast` implementation of
156 // the core library has calls that may not already be analyzed,
157 // the analysis will conclude that `_tdivFast` may have side
158 // effects.
159 _tdivFast(other) => new List()..length = 42;
155 _shlPositive(other) => 42; 160 _shlPositive(other) => 42;
156 _shrBothPositive(other) => 42; 161 _shrBothPositive(other) => 42;
157 _shrReceiverPositive(other) => 42; 162 _shrReceiverPositive(other) => 42;
158 _shrOtherPositive(other) => 42; 163 _shrOtherPositive(other) => 42;
159 164
160 abs() => (this is JSInt) ? 42 : 42.2; 165 abs() => (this is JSInt) ? 42 : 42.2;
161 remainder(other) => (this is JSInt) ? 42 : 42.2; 166 remainder(other) => (this is JSInt) ? 42 : 42.2;
162 truncate() => 42; 167 truncate() => 42;
163 } 168 }
164 class JSInt extends JSNumber implements int { 169 class JSInt extends JSNumber implements int {
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } else { 563 } else {
559 sourceFile = compiler.sourceFiles[uri.toString()]; 564 sourceFile = compiler.sourceFiles[uri.toString()];
560 } 565 }
561 if (sourceFile != null && begin != null && end != null) { 566 if (sourceFile != null && begin != null && end != null) {
562 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); 567 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x));
563 } else { 568 } else {
564 print(message); 569 print(message);
565 } 570 }
566 }; 571 };
567 } 572 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698