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

Unified Diff: tools/dom/src/dartium_CustomElementSupport.dart

Issue 943043005: Do not allow abstract classes to be registered as custom elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/dartium_CustomElementSupport.dart
diff --git a/tools/dom/src/dartium_CustomElementSupport.dart b/tools/dom/src/dartium_CustomElementSupport.dart
index 3afc56ae4f26580000b18c05fbc3a1430e3f6b8e..a14e07f114f012e3a43b1ff96e4a9d306dec1e8d 100644
--- a/tools/dom/src/dartium_CustomElementSupport.dart
+++ b/tools/dom/src/dartium_CustomElementSupport.dart
@@ -49,6 +49,11 @@ ClassMirror _validateCustomType(Type type) {
}
var className = MirrorSystem.getName(cls.simpleName);
+ if (cls.isAbstract) {
+ throw new UnsupportedError('Invalid custom element '
+ 'class $className is abstract.');
+ }
+
var createdConstructor = cls.declarations[new Symbol('$className.created')];
if (createdConstructor == null ||
createdConstructor is! MethodMirror ||
« 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