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/compiler.dart' as api; | 9 import '../../../lib/compiler/compiler.dart' as api; |
10 import '../../../lib/compiler/implementation/dart2jslib.dart' hide TreeElementMa
pping; | 10 import '../../../lib/compiler/implementation/dart2jslib.dart' hide TreeElementMa
pping; |
(...skipping 24 matching lines...) Expand all Loading... |
35 guard$string(x) { return x; } | 35 guard$string(x) { return x; } |
36 guard$stringOrArray(x) { return x; } | 36 guard$stringOrArray(x) { return x; } |
37 index(a, index) {} | 37 index(a, index) {} |
38 indexSet(a, index, value) {} | 38 indexSet(a, index, value) {} |
39 makeLiteralMap(List keyValuePairs) {} | 39 makeLiteralMap(List keyValuePairs) {} |
40 setRuntimeTypeInfo(a, b) {} | 40 setRuntimeTypeInfo(a, b) {} |
41 getRuntimeTypeInfo(a) {} | 41 getRuntimeTypeInfo(a) {} |
42 stringTypeCheck(x) {} | 42 stringTypeCheck(x) {} |
43 boolConversionCheck(x) {} | 43 boolConversionCheck(x) {} |
44 abstract class JavaScriptIndexingBehavior {} | 44 abstract class JavaScriptIndexingBehavior {} |
| 45 class JSInvocationMirror {} |
45 S() {} | 46 S() {} |
46 assertHelper(a){}'''; | 47 assertHelper(a){}'''; |
47 | 48 |
48 const String DEFAULT_INTERCEPTORSLIB = r''' | 49 const String DEFAULT_INTERCEPTORSLIB = r''' |
49 add$1(receiver, value) {} | 50 add$1(receiver, value) {} |
50 get$length(receiver) {} | 51 get$length(receiver) {} |
51 filter(receiver, predicate) {} | 52 filter(receiver, predicate) {} |
52 removeLast(receiver) {} | 53 removeLast(receiver) {} |
53 iterator(receiver) {} | 54 iterator(receiver) {} |
54 next(receiver) {} | 55 next(receiver) {} |
(...skipping 30 matching lines...) Expand all Loading... |
85 bool enableConcreteTypeInference: false}) | 86 bool enableConcreteTypeInference: false}) |
86 : warnings = [], errors = [], | 87 : warnings = [], errors = [], |
87 sourceFiles = new Map<String, SourceFile>(), | 88 sourceFiles = new Map<String, SourceFile>(), |
88 super(enableTypeAssertions: enableTypeAssertions, | 89 super(enableTypeAssertions: enableTypeAssertions, |
89 enableMinification: enableMinification, | 90 enableMinification: enableMinification, |
90 enableConcreteTypeInference: enableConcreteTypeInference) { | 91 enableConcreteTypeInference: enableConcreteTypeInference) { |
91 coreLibrary = createLibrary("core", coreSource); | 92 coreLibrary = createLibrary("core", coreSource); |
92 // We need to set the assert method to avoid calls with a 'null' | 93 // We need to set the assert method to avoid calls with a 'null' |
93 // target being interpreted as a call to assert. | 94 // target being interpreted as a call to assert. |
94 jsHelperLibrary = createLibrary("helper", helperSource); | 95 jsHelperLibrary = createLibrary("helper", helperSource); |
| 96 importHelperLibrary(coreLibrary); |
95 assertMethod = jsHelperLibrary.find(buildSourceString('assert')); | 97 assertMethod = jsHelperLibrary.find(buildSourceString('assert')); |
96 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); | 98 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); |
97 | 99 |
98 mainApp = mockLibrary(this, ""); | 100 mainApp = mockLibrary(this, ""); |
99 initializeSpecialClasses(); | 101 initializeSpecialClasses(); |
100 // We need to make sure the Object class is resolved. When registering a | 102 // We need to make sure the Object class is resolved. When registering a |
101 // dynamic invocation the ArgumentTypesRegistry eventually iterates over | 103 // dynamic invocation the ArgumentTypesRegistry eventually iterates over |
102 // the interfaces of the Object class which would be 'null' if the class | 104 // the interfaces of the Object class which would be 'null' if the class |
103 // wasn't resolved. | 105 // wasn't resolved. |
104 objectClass.ensureResolved(this); | 106 objectClass.ensureResolved(this); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 operator []=(Node node, Element element) { | 252 operator []=(Node node, Element element) { |
251 map[node] = element; | 253 map[node] = element; |
252 } | 254 } |
253 | 255 |
254 operator [](Node node) => map[node]; | 256 operator [](Node node) => map[node]; |
255 | 257 |
256 void remove(Node node) { | 258 void remove(Node node) { |
257 map.remove(node); | 259 map.remove(node); |
258 } | 260 } |
259 } | 261 } |
OLD | NEW |