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 part of resolution; | 5 part of resolution; |
6 | 6 |
7 abstract class TreeElements { | 7 abstract class TreeElements { |
8 Element operator[](Node node); | 8 Element operator[](Node node); |
9 Selector getSelector(Send send); | 9 Selector getSelector(Send send); |
10 DartType getType(Node node); | 10 DartType getType(Node node); |
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1850 visitLiteralInt(LiteralInt node) { | 1850 visitLiteralInt(LiteralInt node) { |
1851 } | 1851 } |
1852 | 1852 |
1853 visitLiteralDouble(LiteralDouble node) { | 1853 visitLiteralDouble(LiteralDouble node) { |
1854 } | 1854 } |
1855 | 1855 |
1856 visitLiteralBool(LiteralBool node) { | 1856 visitLiteralBool(LiteralBool node) { |
1857 } | 1857 } |
1858 | 1858 |
1859 visitLiteralString(LiteralString node) { | 1859 visitLiteralString(LiteralString node) { |
1860 world.registerSpecialInstantiatedClass(compiler.jsStringClass); | |
ahe
2012/11/12 13:24:11
Perhaps the resolver should just say that a String
ngeoffray
2012/11/13 11:45:16
Done.
| |
1860 } | 1861 } |
1861 | 1862 |
1862 visitLiteralNull(LiteralNull node) { | 1863 visitLiteralNull(LiteralNull node) { |
1863 } | 1864 } |
1864 | 1865 |
1865 visitStringJuxtaposition(StringJuxtaposition node) { | 1866 visitStringJuxtaposition(StringJuxtaposition node) { |
1867 world.registerSpecialInstantiatedClass(compiler.jsStringClass); | |
1866 node.visitChildren(this); | 1868 node.visitChildren(this); |
1867 } | 1869 } |
1868 | 1870 |
1869 visitNodeList(NodeList node) { | 1871 visitNodeList(NodeList node) { |
1870 for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) { | 1872 for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) { |
1871 visit(link.head); | 1873 visit(link.head); |
1872 } | 1874 } |
1873 } | 1875 } |
1874 | 1876 |
1875 visitOperator(Operator node) { | 1877 visitOperator(Operator node) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2067 } | 2069 } |
2068 } | 2070 } |
2069 visit(node.elements); | 2071 visit(node.elements); |
2070 } | 2072 } |
2071 | 2073 |
2072 visitConditional(Conditional node) { | 2074 visitConditional(Conditional node) { |
2073 node.visitChildren(this); | 2075 node.visitChildren(this); |
2074 } | 2076 } |
2075 | 2077 |
2076 visitStringInterpolation(StringInterpolation node) { | 2078 visitStringInterpolation(StringInterpolation node) { |
2079 world.registerSpecialInstantiatedClass(compiler.jsStringClass); | |
2077 node.visitChildren(this); | 2080 node.visitChildren(this); |
2078 } | 2081 } |
2079 | 2082 |
2080 visitStringInterpolationPart(StringInterpolationPart node) { | 2083 visitStringInterpolationPart(StringInterpolationPart node) { |
2081 registerImplicitInvocation(const SourceString('toString'), 0); | 2084 registerImplicitInvocation(const SourceString('toString'), 0); |
2082 node.visitChildren(this); | 2085 node.visitChildren(this); |
2083 } | 2086 } |
2084 | 2087 |
2085 visitBreakStatement(BreakStatement node) { | 2088 visitBreakStatement(BreakStatement node) { |
2086 TargetElement target; | 2089 TargetElement target; |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2603 new Block(new NodeList.empty()), | 2606 new Block(new NodeList.empty()), |
2604 null, Modifiers.EMPTY, null, null); | 2607 null, Modifiers.EMPTY, null, null); |
2605 } | 2608 } |
2606 | 2609 |
2607 isBlackListed(DartType type) { | 2610 isBlackListed(DartType type) { |
2608 LibraryElement lib = element.getLibrary(); | 2611 LibraryElement lib = element.getLibrary(); |
2609 return | 2612 return |
2610 !identical(lib, compiler.coreLibrary) && | 2613 !identical(lib, compiler.coreLibrary) && |
2611 !identical(lib, compiler.coreImplLibrary) && | 2614 !identical(lib, compiler.coreImplLibrary) && |
2612 !identical(lib, compiler.jsHelperLibrary) && | 2615 !identical(lib, compiler.jsHelperLibrary) && |
2616 !identical(lib, compiler.interceptorsLibrary) && | |
2613 (identical(type.element, compiler.dynamicClass) || | 2617 (identical(type.element, compiler.dynamicClass) || |
2614 identical(type.element, compiler.boolClass) || | 2618 identical(type.element, compiler.boolClass) || |
2615 identical(type.element, compiler.numClass) || | 2619 identical(type.element, compiler.numClass) || |
2616 identical(type.element, compiler.intClass) || | 2620 identical(type.element, compiler.intClass) || |
2617 identical(type.element, compiler.doubleClass) || | 2621 identical(type.element, compiler.doubleClass) || |
2618 identical(type.element, compiler.stringClass) || | 2622 identical(type.element, compiler.stringClass) || |
2619 identical(type.element, compiler.nullClass) || | 2623 identical(type.element, compiler.nullClass) || |
2620 identical(type.element, compiler.functionClass)); | 2624 identical(type.element, compiler.functionClass)); |
2621 } | 2625 } |
2622 } | 2626 } |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3070 return e; | 3074 return e; |
3071 } | 3075 } |
3072 | 3076 |
3073 /// Assumed to be called by [resolveRedirectingFactory]. | 3077 /// Assumed to be called by [resolveRedirectingFactory]. |
3074 Element visitReturn(Return node) { | 3078 Element visitReturn(Return node) { |
3075 Node expression = node.expression; | 3079 Node expression = node.expression; |
3076 return finishConstructorReference(visit(expression), | 3080 return finishConstructorReference(visit(expression), |
3077 expression, expression); | 3081 expression, expression); |
3078 } | 3082 } |
3079 } | 3083 } |
OLD | NEW |