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

Unified Diff: lib/compiler/implementation/typechecker.dart

Issue 10558023: New treatment of native methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tests added Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/compiler/dart2js/parser_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/typechecker.dart
diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart
index f7af728c82d0e26475f72e4005f537d71d0599ab..54698b8aa099814b8cef111481931ddde1977098 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -601,6 +601,10 @@ class TypeCheckerVisitor implements Visitor<Type> {
/** Dart Programming Language Specification: 11.10 Return */
Type visitReturn(Return node) {
+ if (node.getBeginToken().stringValue === 'native') {
+ return StatementType.RETURNING;
+ }
+
final expression = node.expression;
final isVoidFunction = (expectedReturnType === types.voidType);
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/compiler/dart2js/parser_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698