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

Unified Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 12211112: Start work on a non-complete type inferrer. Currently only analyzes return types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/cpa_inference_test.dart ('k') | tests/language/return_this_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mock_compiler.dart
===================================================================
--- tests/compiler/dart2js/mock_compiler.dart (revision 18442)
+++ tests/compiler/dart2js/mock_compiler.dart (working copy)
@@ -69,23 +69,25 @@
toString() {}
}
class JSNumber {
- operator-() {}
- operator +(other) {}
- operator -(other) {}
- operator ~/(other) {}
- operator /(other) {}
- operator *(other) {}
- operator <<(other) {}
- operator >>(other) {}
- operator |(other) {}
- operator &(other) {}
- operator ^(other) {}
- operator >(other) {}
- operator >=(other) {}
- operator <(other) {}
- operator <=(other) {}
- operator ==(other) {}
- operator %(other) {}
+ // All these methods return a number to please type inferencing.
+ operator-() => (this is JSInt) ? 42 : 42.0;
+ operator +(other) => (this is JSInt) ? 42 : 42.0;
+ operator -(other) => (this is JSInt) ? 42 : 42.0;
+ operator ~/(other) => 42;
+ operator /(other) => (this is JSInt) ? 42 : 42.0;
+ operator *(other) => (this is JSInt) ? 42 : 42.0;
+ operator %(other) => (this is JSInt) ? 42 : 42.0;
+ operator <<(other) => 42;
+ operator >>(other) => 42;
+ operator |(other) => 42;
+ operator &(other) => 42;
+ operator ^(other) => 42;
+
+ operator >(other) => true;
+ operator >=(other) => true;
+ operator <(other) => true;
+ operator <=(other) => true;
+ operator ==(other) => true;
}
class JSInt {
}
« no previous file with comments | « tests/compiler/dart2js/cpa_inference_test.dart ('k') | tests/language/return_this_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698