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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 11416004: Reject deprecated language features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: abstract class in resolver test Created 8 years, 1 month 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
Index: dart/sdk/lib/_internal/compiler/implementation/native_handler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/native_handler.dart b/dart/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 874e8296c0ad9b1ca09ef483e462ccf75f7d1441..038fbdd6872687704bf542294180f5851ac18107 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -192,13 +192,16 @@ class NativeEnqueuerBase implements NativeEnqueuer {
}
bool isNativeMethod(Element element) {
+ if (!element.getLibrary().canUseNative) return false;
// Native method?
- Node node = element.parseNode(compiler);
- if (node is! FunctionExpression) return false;
- node = node.body;
- Token token = node.getBeginToken();
- if (token.stringValue == 'native') return true;
- return false;
+ return compiler.withCurrentElement(element, () {
+ Node node = element.parseNode(compiler);
+ if (node is! FunctionExpression) return false;
+ node = node.body;
+ Token token = node.getBeginToken();
+ if (identical(token.stringValue, 'native')) return true;
+ return false;
+ });
}
void registerFieldLoad(Element field) {

Powered by Google App Engine
This is Rietveld 408576698