| 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) {
|
|
|