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

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

Issue 14120008: Add special rules in the inferrer that some int operations return an int. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months 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:collection'; 8 import 'dart:collection';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 operator >>(other) => 42; 105 operator >>(other) => 42;
106 operator |(other) => 42; 106 operator |(other) => 42;
107 operator &(other) => 42; 107 operator &(other) => 42;
108 operator ^(other) => 42; 108 operator ^(other) => 42;
109 109
110 operator >(other) => true; 110 operator >(other) => true;
111 operator >=(other) => true; 111 operator >=(other) => true;
112 operator <(other) => true; 112 operator <(other) => true;
113 operator <=(other) => true; 113 operator <=(other) => true;
114 operator ==(other) => true; 114 operator ==(other) => true;
115
116 abs() => (this is JSInt) ? 42 : 42.0;
117 remainder(other) => (this is JSInt) ? 42 : 42.0;
115 } 118 }
116 class JSInt extends JSNumber implements int { 119 class JSInt extends JSNumber implements int {
117 } 120 }
118 class JSDouble extends JSNumber implements double { 121 class JSDouble extends JSNumber implements double {
119 } 122 }
120 class JSNull extends Interceptor { 123 class JSNull extends Interceptor {
121 bool operator==(other) => identical(null, other); 124 bool operator==(other) => identical(null, other);
122 } 125 }
123 class JSBool extends Interceptor implements bool { 126 class JSBool extends Interceptor implements bool {
124 } 127 }
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 397 }
395 } 398 }
396 399
397 class MockDeferredLoadTask extends DeferredLoadTask { 400 class MockDeferredLoadTask extends DeferredLoadTask {
398 MockDeferredLoadTask(Compiler compiler) : super(compiler); 401 MockDeferredLoadTask(Compiler compiler) : super(compiler);
399 402
400 void registerMainApp(LibraryElement mainApp) { 403 void registerMainApp(LibraryElement mainApp) {
401 // Do nothing. 404 // Do nothing.
402 } 405 }
403 } 406 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698