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

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

Issue 30283002: Adding validation that Custom element constructor has zero args (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « tests/html/custom/created_callback_test.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/native_DOMImplementation.dart
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index cbea9eda1b4dc69f198b662d1de38e16057cb770..0cc189c638e1f8749aba307227314124803f02eb 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -412,8 +412,14 @@ class _Utils {
throw new UnsupportedError("Invalid custom element from $libName.");
}
var className = MirrorSystem.getName(cls.simpleName);
- if (!cls.constructors.containsKey(new Symbol('$className.created'))) {
- throw new UnsupportedError('Class is missing constructor $className.created');
+ var createdConstructor = cls.constructors[new Symbol('$className.created')];
+ if (createdConstructor == null) {
+ throw new UnsupportedError(
+ 'Class is missing constructor $className.created');
+ }
+ if (createdConstructor.parameters.length > 0) {
+ throw new UnsupportedError(
+ 'Constructor $className.created must take zero arguments');
}
_register(document, tag, type, extendsTagName);
}
« no previous file with comments | « tests/html/custom/created_callback_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698