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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 11308257: - Parse the return type of JS during resolution to know what can be instantiated there. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 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 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 // We call 'call()' on a Type instance returned from the reference to a 1813 // We call 'call()' on a Type instance returned from the reference to a
1814 // class or typedef literal. We do not need to register this call as a 1814 // class or typedef literal. We do not need to register this call as a
1815 // dynamic invocation, because we statically know what the target is. 1815 // dynamic invocation, because we statically know what the target is.
1816 } else if (!selector.applies(target, compiler)) { 1816 } else if (!selector.applies(target, compiler)) {
1817 warnArgumentMismatch(node, target); 1817 warnArgumentMismatch(node, target);
1818 } 1818 }
1819 1819
1820 if (target != null && 1820 if (target != null &&
1821 target.kind == ElementKind.FOREIGN && 1821 target.kind == ElementKind.FOREIGN &&
1822 selector.name == const SourceString('JS')) { 1822 selector.name == const SourceString('JS')) {
1823 world.nativeEnqueuer.registerJsCall(node, this); 1823 world.registerJsCall(node, this);
1824 } 1824 }
1825 } 1825 }
1826 1826
1827 // TODO(ngeoffray): Warn if target is null and the send is 1827 // TODO(ngeoffray): Warn if target is null and the send is
1828 // unqualified. 1828 // unqualified.
1829 useElement(node, target); 1829 useElement(node, target);
1830 registerSend(selector, target); 1830 registerSend(selector, target);
1831 if (node.isPropertyAccess) { 1831 if (node.isPropertyAccess) {
1832 // It might be the closurization of a method. 1832 // It might be the closurization of a method.
1833 world.registerInstantiatedClass(compiler.functionClass); 1833 world.registerInstantiatedClass(compiler.functionClass);
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
3171 return e; 3171 return e;
3172 } 3172 }
3173 3173
3174 /// Assumed to be called by [resolveRedirectingFactory]. 3174 /// Assumed to be called by [resolveRedirectingFactory].
3175 Element visitReturn(Return node) { 3175 Element visitReturn(Return node) {
3176 Node expression = node.expression; 3176 Node expression = node.expression;
3177 return finishConstructorReference(visit(expression), 3177 return finishConstructorReference(visit(expression),
3178 expression, expression); 3178 expression, expression);
3179 } 3179 }
3180 } 3180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698