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

Unified Diff: pkg/polymer/lib/src/instance.dart

Issue 89713002: clarify that users of Polymer mixin have to call polymerCreated (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: much better Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/instance.dart
diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart
index f3ad9eadf381f1955135cd06f494399efbb4dd00..b9b81bf7db402d243ea7d84a109552963802888f 100644
--- a/pkg/polymer/lib/src/instance.dart
+++ b/pkg/polymer/lib/src/instance.dart
@@ -24,6 +24,9 @@ class PublishedProperty extends ObservableProperty {
/**
* The mixin class for Polymer elements. It provides convenience features on top
* of the custom elements web standard.
+ *
+ * If this class is used as a mixin,
+ * you must call `polymerCreated()` from the body of your constructor.
*/
abstract class Polymer implements Element, Observable, NodeBindExtension {
// Fully ported from revision:
@@ -124,6 +127,12 @@ abstract class Polymer implements Element, Observable, NodeBindExtension {
// TODO(jmesserly): Polymer does not have this feature. Reconcile.
ShadowRoot getShadowRoot(String customTagName) => _shadowRoots[customTagName];
+ /**
+ * If this class is used as a mixin, this method must be called from inside
+ * of the `created()` constructor.
+ *
+ * If this class is a superclass, calling `super.created()` is sufficient.
+ */
void polymerCreated() {
if (this.ownerDocument.window != null || alwaysPrepare ||
_preparingElements > 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698