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

Side by Side Diff: tools/dom/src/html_native_DOMImplementation.dart

Issue 313763002: Ignore mirrors without valid names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of html; 5 part of html;
6 6
7 class _Property { 7 class _Property {
8 _Property(this.name) : 8 _Property(this.name) :
9 _hasValue = false, 9 _hasValue = false,
10 writable = false, 10 writable = false,
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 _addStatics(classMirror, properties, accessorPropertiesOnly); 591 _addStatics(classMirror, properties, accessorPropertiesOnly);
592 return packageProperties(properties); 592 return packageProperties(properties);
593 } 593 }
594 594
595 static void _addStatics(ClassMirror classMirror, 595 static void _addStatics(ClassMirror classMirror,
596 Map<String, _Property> properties, 596 Map<String, _Property> properties,
597 bool accessorPropertiesOnly) { 597 bool accessorPropertiesOnly) {
598 var libraryMirror = classMirror.owner; 598 var libraryMirror = classMirror.owner;
599 classMirror.declarations.forEach((symbol, declaration) { 599 classMirror.declarations.forEach((symbol, declaration) {
600 var name = _getShortSymbolName(symbol, declaration); 600 var name = _getShortSymbolName(symbol, declaration);
601 if (name.isEmpty) return;
601 if (declaration is VariableMirror) { 602 if (declaration is VariableMirror) {
602 if (accessorPropertiesOnly) return; 603 if (accessorPropertiesOnly) return;
603 if (!declaration.isStatic) return; 604 if (!declaration.isStatic) return;
604 properties.putIfAbsent(name, () => new _Property(name)) 605 properties.putIfAbsent(name, () => new _Property(name))
605 ..value = classMirror.getField(symbol).reflectee 606 ..value = classMirror.getField(symbol).reflectee
606 ..writable = !declaration.isFinal && !declaration.isConst; 607 ..writable = !declaration.isFinal && !declaration.isConst;
607 } else if (declaration is MethodMirror) { 608 } else if (declaration is MethodMirror) {
608 MethodMirror methodMirror = declaration; 609 MethodMirror methodMirror = declaration;
609 // FIXMEDART: should we display constructors? 610 // FIXMEDART: should we display constructors?
610 if (methodMirror.isConstructor) return; 611 if (methodMirror.isConstructor) return;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 static void _addInstanceMirrors( 669 static void _addInstanceMirrors(
669 ObjectMirror objectMirror, 670 ObjectMirror objectMirror,
670 LibraryMirror libraryMirror, 671 LibraryMirror libraryMirror,
671 Map<Symbol, Mirror> declarations, 672 Map<Symbol, Mirror> declarations,
672 bool ownProperties, bool accessorPropertiesOnly, 673 bool ownProperties, bool accessorPropertiesOnly,
673 bool hideFields, bool hideMethods, 674 bool hideFields, bool hideMethods,
674 Map<String, _Property> properties) { 675 Map<String, _Property> properties) {
675 declarations.forEach((Symbol symbol, Mirror declaration) { 676 declarations.forEach((Symbol symbol, Mirror declaration) {
676 if (declaration is TypedefMirror || declaration is ClassMirror) return; 677 if (declaration is TypedefMirror || declaration is ClassMirror) return;
677 var name = _getShortSymbolName(symbol, declaration); 678 var name = _getShortSymbolName(symbol, declaration);
679 if (name.isEmpty) return;
678 bool isField = declaration is VariableMirror || 680 bool isField = declaration is VariableMirror ||
679 (declaration is MethodMirror && 681 (declaration is MethodMirror &&
680 treatPropertyAsField(declaration, libraryMirror)); 682 treatPropertyAsField(declaration, libraryMirror));
681 if ((isField && hideFields) || (hideMethods && !isField)) return; 683 if ((isField && hideFields) || (hideMethods && !isField)) return;
682 if (accessorPropertiesOnly) { 684 if (accessorPropertiesOnly) {
683 if (declaration is VariableMirror || declaration.isRegularMethod || 685 if (declaration is VariableMirror || declaration.isRegularMethod ||
684 isField) { 686 isField) {
685 return; 687 return;
686 } 688 }
687 } else if (declaration is MethodMirror && 689 } else if (declaration is MethodMirror &&
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 _scheduleImmediateHelper._schedule(callback); 980 _scheduleImmediateHelper._schedule(callback);
979 }; 981 };
980 982
981 get _pureIsolateScheduleImmediateClosure => ((void callback()) => 983 get _pureIsolateScheduleImmediateClosure => ((void callback()) =>
982 throw new UnimplementedError("scheduleMicrotask in background isolates " 984 throw new UnimplementedError("scheduleMicrotask in background isolates "
983 "are not supported in the browser")); 985 "are not supported in the browser"));
984 986
985 void _initializeCustomElement(Element e) { 987 void _initializeCustomElement(Element e) {
986 _Utils.initializeCustomElement(e); 988 _Utils.initializeCustomElement(e);
987 } 989 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698