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

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

Issue 87783003: Add UInt32 and UInt31 types to better infer bit operations. (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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mirror_final_field_inferrer_test.dart ('k') | tests/compiler/dart2js/simple_inferrer_closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698