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

Side by Side Diff: pkg/compiler/lib/src/js_backend/js_interop_analysis.dart

Issue 2731173002: Add ClassEntity.library, MemberEntity.library and FunctionEntity.isExternal (Closed)
Patch Set: Created 3 years, 9 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 /// Analysis to determine how to generate code for typed JavaScript interop. 5 /// Analysis to determine how to generate code for typed JavaScript interop.
6 library compiler.src.js_backend.js_interop_analysis; 6 library compiler.src.js_backend.js_interop_analysis;
7 7
8 import '../common.dart'; 8 import '../common.dart';
9 import '../constants/values.dart' 9 import '../constants/values.dart'
10 show ConstantValue, ConstructedConstantValue, StringConstantValue; 10 show ConstantValue, ConstructedConstantValue, StringConstantValue;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, { 147 MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, {
148 'cls': classElement.name, 148 'cls': classElement.name,
149 'superclass': classElement.superclass.name 149 'superclass': classElement.superclass.name
150 }); 150 });
151 } 151 }
152 152
153 classElement 153 classElement
154 .forEachMember((ClassElement classElement, MemberElement member) { 154 .forEachMember((ClassElement classElement, MemberElement member) {
155 String memberName = processJsInteropAnnotation(member); 155 String memberName = processJsInteropAnnotation(member);
156 if (memberName != null) { 156 if (memberName != null) {
157 backend.nativeDataBuilder.setJsInteropMemberName(element, memberName); 157 backend.nativeDataBuilder.setJsInteropMemberName(member, memberName);
158 } 158 }
159 159
160 if (!member.isSynthesized && 160 if (!member.isSynthesized &&
161 backend.nativeData.isJsInteropClass(classElement) && 161 backend.nativeData.isJsInteropClass(classElement) &&
162 member is MethodElement) { 162 member is MethodElement) {
163 MethodElement fn = member; 163 MethodElement fn = member;
164 if (!fn.isExternal && 164 if (!fn.isExternal &&
165 !fn.isAbstract && 165 !fn.isAbstract &&
166 !fn.isConstructor && 166 !fn.isConstructor &&
167 !fn.isStatic) { 167 !fn.isStatic) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 ResolutionFunctionType buildJsFunctionType() { 218 ResolutionFunctionType buildJsFunctionType() {
219 // TODO(jacobr): consider using codegenWorldBuilder.isChecks to determine th e 219 // TODO(jacobr): consider using codegenWorldBuilder.isChecks to determine th e
220 // range of positional arguments that need to be supported by JavaScript 220 // range of positional arguments that need to be supported by JavaScript
221 // function types. 221 // function types.
222 return new ResolutionFunctionType.synthesized( 222 return new ResolutionFunctionType.synthesized(
223 const ResolutionDynamicType(), 223 const ResolutionDynamicType(),
224 [], 224 [],
225 new List<ResolutionDartType>.filled(16, const ResolutionDynamicType())); 225 new List<ResolutionDartType>.filled(16, const ResolutionDynamicType()));
226 } 226 }
227 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698