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

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

Issue 2995643002: Support jsinterop/world_test from .dill (Closed)
Patch Set: Created 3 years, 4 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library js_backend.native_data; 5 library js_backend.native_data;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common_elements.dart' show ElementEnvironment; 8 import '../common_elements.dart' show ElementEnvironment;
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../native/behavior.dart' show NativeBehavior; 10 import '../native/behavior.dart' show NativeBehavior;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 @override 284 @override
285 bool isJsInteropLibrary(LibraryEntity element) { 285 bool isJsInteropLibrary(LibraryEntity element) {
286 return jsInteropLibraries.containsKey(element); 286 return jsInteropLibraries.containsKey(element);
287 } 287 }
288 288
289 @override 289 @override
290 bool isJsInteropClass(ClassEntity element) { 290 bool isJsInteropClass(ClassEntity element) {
291 return jsInteropClasses.containsKey(element); 291 return jsInteropClasses.containsKey(element);
292 } 292 }
293 293
294 bool _isJsInteropMember(MemberEntity element) {
295 return jsInteropMembers.containsKey(element);
296 }
297
294 @override 298 @override
295 bool isJsInteropMember(MemberEntity element) { 299 bool isJsInteropMember(MemberEntity element) {
296 return jsInteropMembers.containsKey(element); 300 // TODO(johnniwinther): Share this with [NativeDataImpl.isJsInteropMember].
301 if (element.isFunction ||
302 element.isConstructor ||
303 element.isGetter ||
304 element.isSetter) {
305 FunctionEntity function = element;
306 if (!function.isExternal) return false;
307
308 if (_isJsInteropMember(function)) return true;
309 if (function.enclosingClass != null) {
310 return isJsInteropClass(function.enclosingClass);
311 }
312 if (function.isTopLevel) {
313 return isJsInteropLibrary(function.library);
314 }
315 return false;
316 } else {
317 return _isJsInteropMember(element);
318 }
297 } 319 }
298 320
299 @override 321 @override
300 bool isNativeOrExtendsNative(ClassEntity element) { 322 bool isNativeOrExtendsNative(ClassEntity element) {
301 if (element == null) return false; 323 if (element == null) return false;
302 if (isNativeClass(element) || isJsInteropClass(element)) { 324 if (isNativeClass(element) || isJsInteropClass(element)) {
303 return true; 325 return true;
304 } 326 }
305 return isNativeOrExtendsNative(_env.getSuperClass(element)); 327 return isNativeOrExtendsNative(_env.getSuperClass(element));
306 } 328 }
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 int get hashCode => Hashing.listHash(names, isNonLeaf.hashCode); 717 int get hashCode => Hashing.listHash(names, isNonLeaf.hashCode);
696 718
697 bool operator ==(other) { 719 bool operator ==(other) {
698 if (identical(this, other)) return true; 720 if (identical(this, other)) return true;
699 if (other is! NativeClassTag) return false; 721 if (other is! NativeClassTag) return false;
700 return equalElements(names, other.names) && isNonLeaf == other.isNonLeaf; 722 return equalElements(names, other.names) && isNonLeaf == other.isNonLeaf;
701 } 723 }
702 724
703 String toString() => text; 725 String toString() => text;
704 } 726 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/kernel/element_map.dart » ('j') | pkg/compiler/lib/src/kernel/element_map.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698