Chromium Code Reviews| OLD | NEW |
|---|---|
| 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:uri"); | 7 #import("dart:uri"); |
| 8 | 8 |
| 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); | 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); |
| 10 #import("../../../lib/compiler/implementation/leg.dart"); | 10 #import("../../../lib/compiler/implementation/leg.dart"); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 add$1(receiver, value) {} | 48 add$1(receiver, value) {} |
| 49 get$length(receiver) {} | 49 get$length(receiver) {} |
| 50 filter(receiver, predicate) {} | 50 filter(receiver, predicate) {} |
| 51 removeLast(receiver) {} | 51 removeLast(receiver) {} |
| 52 iterator(receiver) {} | 52 iterator(receiver) {} |
| 53 next(receiver) {} | 53 next(receiver) {} |
| 54 hasNext(receiver) {}'''; | 54 hasNext(receiver) {}'''; |
| 55 | 55 |
| 56 const String DEFAULT_CORELIB = r''' | 56 const String DEFAULT_CORELIB = r''' |
| 57 print(var obj) {} | 57 print(var obj) {} |
| 58 abstract class int extends num {} | 58 abstract class num { operator +(x); operator *(x); operator -(x); } |
|
karlklose
2012/10/23 10:58:15
I am not sure we want to add these operators here.
polux
2012/10/25 12:02:01
Done.
| |
| 59 abstract class double extends num {} | 59 abstract class int extends num { } |
| 60 abstract class double extends num { } | |
| 60 class bool {} | 61 class bool {} |
| 61 class String {} | 62 class String {} |
| 62 class Object {} | 63 class Object {} |
| 63 abstract class num {} | |
| 64 class Function {} | 64 class Function {} |
| 65 interface List default ListImplementation { List([length]);} | 65 interface List default ListImplementation { List([length]);} |
| 66 class ListImplementation { factory List([length]) => null; } | 66 class ListImplementation { factory List([length]) => null; } |
| 67 abstract class Map {} | 67 abstract class Map {} |
| 68 class Closure {} | 68 class Closure {} |
| 69 class Null {} | 69 class Null {} |
| 70 class Dynamic_ {} | 70 class Dynamic_ {} |
| 71 bool identical(Object a, Object b) {}'''; | 71 bool identical(Object a, Object b) {}'''; |
| 72 | 72 |
| 73 class MockCompiler extends Compiler { | 73 class MockCompiler extends Compiler { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 }); | 226 }); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 LibraryElement mockLibrary(Compiler compiler, String source) { | 230 LibraryElement mockLibrary(Compiler compiler, String source) { |
| 231 Uri uri = new Uri.fromComponents(scheme: "source"); | 231 Uri uri = new Uri.fromComponents(scheme: "source"); |
| 232 var library = new LibraryElement(new Script(uri, new MockFile(source))); | 232 var library = new LibraryElement(new Script(uri, new MockFile(source))); |
| 233 importLibrary(library, compiler.coreLibrary, compiler); | 233 importLibrary(library, compiler.coreLibrary, compiler); |
| 234 return library; | 234 return library; |
| 235 } | 235 } |
| OLD | NEW |