| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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("../../../leg/leg.dart"); | 7 #import("../../../leg/leg.dart"); |
| 8 #import("../../../leg/elements/elements.dart"); | 8 #import("../../../leg/elements/elements.dart"); |
| 9 #import("../../../leg/tree/tree.dart"); | 9 #import("../../../leg/tree/tree.dart"); |
| 10 #import("../../../leg/util/util.dart"); | 10 #import("../../../leg/util/util.dart"); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 new Element(buildSourceString(''), ElementKind.FUNCTION, null); | 91 new Element(buildSourceString(''), ElementKind.FUNCTION, null); |
| 92 ResolverVisitor visitor = new FullResolverVisitor(this, mockElement); | 92 ResolverVisitor visitor = new FullResolverVisitor(this, mockElement); |
| 93 visitor.context = new BlockScope(visitor.context); | 93 visitor.context = new BlockScope(visitor.context); |
| 94 return visitor; | 94 return visitor; |
| 95 } | 95 } |
| 96 | 96 |
| 97 parseScript(String text) { | 97 parseScript(String text) { |
| 98 for (Link<Element> link = parseUnit(text, this); | 98 for (Link<Element> link = parseUnit(text, this); |
| 99 !link.isEmpty(); | 99 !link.isEmpty(); |
| 100 link = link.tail) { | 100 link = link.tail) { |
| 101 universe.define(link.head); | 101 universe.define(link.head, this); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 void enqueue(WorkItem work) { | 105 void enqueue(WorkItem work) { |
| 106 if (work.isBailoutVersion()) lastBailoutWork = work; | 106 if (work.isBailoutVersion()) lastBailoutWork = work; |
| 107 super.enqueue(work); | 107 super.enqueue(work); |
| 108 } | 108 } |
| 109 | 109 |
| 110 resolve(ClassElement element) { | 110 resolve(ClassElement element) { |
| 111 return resolver.resolveType(element); | 111 return resolver.resolveType(element); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 129 } while (expected.hasNext()); | 129 } while (expected.hasNext()); |
| 130 fail('Too few warnings'); | 130 fail('Too few warnings'); |
| 131 } | 131 } |
| 132 if (found.hasNext()) { | 132 if (found.hasNext()) { |
| 133 do { | 133 do { |
| 134 print('Additional warning "${found.next()}"'); | 134 print('Additional warning "${found.next()}"'); |
| 135 } while (found.hasNext()); | 135 } while (found.hasNext()); |
| 136 fail('Too many warnings'); | 136 fail('Too many warnings'); |
| 137 } | 137 } |
| 138 } | 138 } |
| OLD | NEW |