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

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 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 // We call 'call()' on a Type instance returned from the reference to a 1801 // We call 'call()' on a Type instance returned from the reference to a
1802 // class or typedef literal. We do not need to register this call as a 1802 // class or typedef literal. We do not need to register this call as a
1803 // dynamic invocation, because we statically know what the target is. 1803 // dynamic invocation, because we statically know what the target is.
1804 } else if (!selector.applies(target, compiler)) { 1804 } else if (!selector.applies(target, compiler)) {
1805 warnArgumentMismatch(node, target); 1805 warnArgumentMismatch(node, target);
1806 } 1806 }
1807 1807
1808 if (target != null && 1808 if (target != null &&
1809 target.kind == ElementKind.FOREIGN && 1809 target.kind == ElementKind.FOREIGN &&
1810 selector.name == const SourceString('JS')) { 1810 selector.name == const SourceString('JS')) {
1811 world.nativeEnqueuer.registerJsCall(node, this); 1811 world.registerJsCall(node, this);
1812 } 1812 }
1813 } 1813 }
1814 1814
1815 // TODO(ngeoffray): Warn if target is null and the send is 1815 // TODO(ngeoffray): Warn if target is null and the send is
1816 // unqualified. 1816 // unqualified.
1817 useElement(node, target); 1817 useElement(node, target);
1818 registerSend(selector, target); 1818 registerSend(selector, target);
1819 if (node.isPropertyAccess) { 1819 if (node.isPropertyAccess) {
1820 // It might be the closurization of a method. 1820 // It might be the closurization of a method.
1821 world.registerInstantiatedClass(compiler.functionClass); 1821 world.registerInstantiatedClass(compiler.functionClass);
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
3159 return e; 3159 return e;
3160 } 3160 }
3161 3161
3162 /// Assumed to be called by [resolveRedirectingFactory]. 3162 /// Assumed to be called by [resolveRedirectingFactory].
3163 Element visitReturn(Return node) { 3163 Element visitReturn(Return node) {
3164 Node expression = node.expression; 3164 Node expression = node.expression;
3165 return finishConstructorReference(visit(expression), 3165 return finishConstructorReference(visit(expression),
3166 expression, expression); 3166 expression, expression);
3167 } 3167 }
3168 } 3168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698