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

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

Issue 14890026: Handle switch statement in simple types inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 operator[]=(index, value) {} 90 operator[]=(index, value) {}
91 var add; 91 var add;
92 } 92 }
93 class JSMutableArray extends JSArray implements JSMutableIndexable {} 93 class JSMutableArray extends JSArray implements JSMutableIndexable {}
94 class JSFixedArray extends JSMutableArray {} 94 class JSFixedArray extends JSMutableArray {}
95 class JSExtendableArray extends JSMutableArray {} 95 class JSExtendableArray extends JSMutableArray {}
96 class JSString extends Interceptor implements String, JSIndexable { 96 class JSString extends Interceptor implements String, JSIndexable {
97 var length; 97 var length;
98 operator[](index) {} 98 operator[](index) {}
99 toString() {} 99 toString() {}
100 operator+(other) => this;
100 } 101 }
101 class JSNumber extends Interceptor implements num { 102 class JSNumber extends Interceptor implements num {
102 // All these methods return a number to please type inferencing. 103 // All these methods return a number to please type inferencing.
103 operator-() => (this is JSInt) ? 42 : 42.0; 104 operator-() => (this is JSInt) ? 42 : 42.0;
104 operator +(other) => (this is JSInt) ? 42 : 42.0; 105 operator +(other) => (this is JSInt) ? 42 : 42.0;
105 operator -(other) => (this is JSInt) ? 42 : 42.0; 106 operator -(other) => (this is JSInt) ? 42 : 42.0;
106 operator ~/(other) => 42; 107 operator ~/(other) => 42;
107 operator /(other) => (this is JSInt) ? 42 : 42.0; 108 operator /(other) => (this is JSInt) ? 42 : 42.0;
108 operator *(other) => (this is JSInt) ? 42 : 42.0; 109 operator *(other) => (this is JSInt) ? 42 : 42.0;
109 operator %(other) => (this is JSInt) ? 42 : 42.0; 110 operator %(other) => (this is JSInt) ? 42 : 42.0;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 } 409 }
409 } 410 }
410 411
411 class MockDeferredLoadTask extends DeferredLoadTask { 412 class MockDeferredLoadTask extends DeferredLoadTask {
412 MockDeferredLoadTask(Compiler compiler) : super(compiler); 413 MockDeferredLoadTask(Compiler compiler) : super(compiler);
413 414
414 void registerMainApp(LibraryElement mainApp) { 415 void registerMainApp(LibraryElement mainApp) {
415 // Do nothing. 416 // Do nothing.
416 } 417 }
417 } 418 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698