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

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

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 years, 6 months 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 get currentElement; 8 Element get currentElement;
9 Set<Node> get superUses; 9 Set<Node> get superUses;
10 10
(...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 initializerDo(parameterNode, (n) => n.accept(this)); 1894 initializerDo(parameterNode, (n) => n.accept(this));
1895 // Field parameters (this.x) are not visible inside the constructor. The 1895 // Field parameters (this.x) are not visible inside the constructor. The
1896 // fields they reference are visible, but must be resolved independently. 1896 // fields they reference are visible, but must be resolved independently.
1897 if (element.kind == ElementKind.FIELD_PARAMETER) { 1897 if (element.kind == ElementKind.FIELD_PARAMETER) {
1898 useElement(parameterNode, element); 1898 useElement(parameterNode, element);
1899 } else { 1899 } else {
1900 defineElement(variableDefinitions.definitions.nodes.head, element); 1900 defineElement(variableDefinitions.definitions.nodes.head, element);
1901 } 1901 }
1902 parameterNodes = parameterNodes.tail; 1902 parameterNodes = parameterNodes.tail;
1903 }); 1903 });
1904 if (inCheckContext) {
1905 functionParameters.forEachParameter((Element element) {
1906 compiler.enqueuer.resolution.registerIsCheck(
1907 element.computeType(compiler), mapping);
1908 });
1909 }
1904 } 1910 }
1905 1911
1906 visitCascade(Cascade node) { 1912 visitCascade(Cascade node) {
1907 visit(node.expression); 1913 visit(node.expression);
1908 } 1914 }
1909 1915
1910 visitCascadeReceiver(CascadeReceiver node) { 1916 visitCascadeReceiver(CascadeReceiver node) {
1911 visit(node.expression); 1917 visit(node.expression);
1912 } 1918 }
1913 1919
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 enclosingElement = function; 1997 enclosingElement = function;
1992 // Run the body in a fresh statement scope. 1998 // Run the body in a fresh statement scope.
1993 StatementScope oldStatementScope = statementScope; 1999 StatementScope oldStatementScope = statementScope;
1994 statementScope = new StatementScope(); 2000 statementScope = new StatementScope();
1995 visit(node.body); 2001 visit(node.body);
1996 statementScope = oldStatementScope; 2002 statementScope = oldStatementScope;
1997 2003
1998 scope = oldScope; 2004 scope = oldScope;
1999 enclosingElement = previousEnclosingElement; 2005 enclosingElement = previousEnclosingElement;
2000 2006
2007 world.registerClosurizedMember(function, mapping);
2001 world.registerInstantiatedClass(compiler.functionClass, mapping); 2008 world.registerInstantiatedClass(compiler.functionClass, mapping);
2002 } 2009 }
2003 2010
2004 visitIf(If node) { 2011 visitIf(If node) {
2005 visit(node.condition); 2012 visit(node.condition);
2006 visitIn(node.thenPart, new BlockScope(scope)); 2013 visitIn(node.thenPart, new BlockScope(scope));
2007 visitIn(node.elsePart, new BlockScope(scope)); 2014 visitIn(node.elsePart, new BlockScope(scope));
2008 } 2015 }
2009 2016
2010 static bool isLogicalOperator(Identifier op) { 2017 static bool isLogicalOperator(Identifier op) {
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
4047 return e; 4054 return e;
4048 } 4055 }
4049 4056
4050 /// Assumed to be called by [resolveRedirectingFactory]. 4057 /// Assumed to be called by [resolveRedirectingFactory].
4051 Element visitReturn(Return node) { 4058 Element visitReturn(Return node) {
4052 Node expression = node.expression; 4059 Node expression = node.expression;
4053 return finishConstructorReference(visit(expression), 4060 return finishConstructorReference(visit(expression),
4054 expression, expression); 4061 expression, expression);
4055 } 4062 }
4056 } 4063 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698