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

Side by Side Diff: pkg/dev_compiler/lib/src/compiler/js_interop.dart

Issue 2962263002: fix #30030, fix #27327 - fix tearoffs and various Object member bugs (Closed)
Patch Set: fix Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/src/generated/constant.dart'; 6 import 'package:analyzer/src/generated/constant.dart';
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 8
9 import 'element_helpers.dart'; 9 import 'element_helpers.dart';
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 bool isJsPeerInterface(DartObjectImpl value) => 67 bool isJsPeerInterface(DartObjectImpl value) =>
68 _isBuiltinAnnotation(value, '_js_helper', 'JsPeerInterface'); 68 _isBuiltinAnnotation(value, '_js_helper', 'JsPeerInterface');
69 69
70 bool isNativeAnnotation(DartObjectImpl value) => 70 bool isNativeAnnotation(DartObjectImpl value) =>
71 _isBuiltinAnnotation(value, '_js_helper', 'Native'); 71 _isBuiltinAnnotation(value, '_js_helper', 'Native');
72 72
73 /// Returns the name value of the `JSExportName` annotation (when compiling 73 /// Returns the name value of the `JSExportName` annotation (when compiling
74 /// the SDK), or `null` if there's none. This is used to control the name 74 /// the SDK), or `null` if there's none. This is used to control the name
75 /// under which functions are compiled and exported. 75 /// under which functions are compiled and exported.
76 String getJSExportName(Element e) { 76 String getJSExportName(Element e) {
77 var original = e; 77 if (!e.source.isInSystemLibrary) return null;
78 if (original is PropertyAccessorElement) e = original.variable; 78
79 if (e.source.isInSystemLibrary) { 79 e = e is PropertyAccessorElement && e.isSynthetic ? e.variable : e;
80 var real = original.isSynthetic ? e : original; 80 return getAnnotationName(e, isJSExportNameAnnotation);
81 return getAnnotationName(real, isJSExportNameAnnotation) ?? e.name;
82 }
83 return e.name;
84 } 81 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | pkg/dev_compiler/lib/src/compiler/js_typeref_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698