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

Side by Side 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 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 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; 10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 operator[](index) {} 62 operator[](index) {}
63 operator[]=(index, value) {} 63 operator[]=(index, value) {}
64 var add; 64 var add;
65 } 65 }
66 class JSString { 66 class JSString {
67 var length; 67 var length;
68 operator[](index) {} 68 operator[](index) {}
69 toString() {} 69 toString() {}
70 } 70 }
71 class JSNumber { 71 class JSNumber {
72 operator-() {} 72 // All these methods return a number to please type inferencing.
73 operator +(other) {} 73 operator-() => (this is JSInt) ? 42 : 42.0;
74 operator -(other) {} 74 operator +(other) => (this is JSInt) ? 42 : 42.0;
75 operator ~/(other) {} 75 operator -(other) => (this is JSInt) ? 42 : 42.0;
76 operator /(other) {} 76 operator ~/(other) => 42;
77 operator *(other) {} 77 operator /(other) => (this is JSInt) ? 42 : 42.0;
78 operator <<(other) {} 78 operator *(other) => (this is JSInt) ? 42 : 42.0;
79 operator >>(other) {} 79 operator %(other) => (this is JSInt) ? 42 : 42.0;
80 operator |(other) {} 80 operator <<(other) => 42;
81 operator &(other) {} 81 operator >>(other) => 42;
82 operator ^(other) {} 82 operator |(other) => 42;
83 operator >(other) {} 83 operator &(other) => 42;
84 operator >=(other) {} 84 operator ^(other) => 42;
85 operator <(other) {} 85
86 operator <=(other) {} 86 operator >(other) => true;
87 operator ==(other) {} 87 operator >=(other) => true;
88 operator %(other) {} 88 operator <(other) => true;
89 operator <=(other) => true;
90 operator ==(other) => true;
89 } 91 }
90 class JSInt { 92 class JSInt {
91 } 93 }
92 class JSDouble { 94 class JSDouble {
93 } 95 }
94 class JSNull { 96 class JSNull {
95 } 97 }
96 class JSBool { 98 class JSBool {
97 } 99 }
98 class JSFunction { 100 class JSFunction {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 operator []=(Node node, Element element) { 335 operator []=(Node node, Element element) {
334 map[node] = element; 336 map[node] = element;
335 } 337 }
336 338
337 operator [](Node node) => map[node]; 339 operator [](Node node) => map[node];
338 340
339 void remove(Node node) { 341 void remove(Node node) {
340 map.remove(node); 342 map.remove(node);
341 } 343 }
342 } 344 }
OLDNEW
« 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