Skip to content

Commit

Permalink
Make lazyRegister have 'even lazier' behavior such that behaviors are…
Browse files Browse the repository at this point in the history
… not mixed in until first-instance time.
  • Loading branch information
Steven Orvell committed Jun 25, 2016
1 parent 45ece8a commit 9676d6d
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/lib/base.html
Expand Up @@ -30,10 +30,6 @@

// `this` context is a prototype, not an instance
registerCallback: function() {
if (!settings.lazierRegister) {
this._desugarBehaviors(); // abstract
this._doBehavior('beforeRegister'); // abstract
}
this._registerFeatures(); // abstract
if (!settings.lazyRegister) {
this.ensureRegisterFinished();
Expand Down Expand Up @@ -62,14 +58,12 @@
},

_ensureRegisterFinished: function(proto) {
if (proto.__hasRegisterFinished !== proto.is) {
// TODO(sorvell): moving all behavior work here means that
// custom constructor and is cannot be done in a behavior.
// This probably means we need another flag for this
if (settings.lazierRegister) {
proto._desugarBehaviors(); // abstract
proto._doBehavior('beforeRegister'); // abstract
}
if (proto.__hasRegisterFinished !== proto.is || !proto.is) {
// NOTE: since all behavior is here, this means
// custom constructor and `is` cannot be done in a behavior
// when lazyRegister is true.
proto._desugarBehaviors(); // abstract
proto._doBehavior('beforeRegister'); // abstract
proto.__hasRegisterFinished = proto.is;
if (proto._finishRegisterFeatures) {
proto._finishRegisterFeatures();
Expand Down

0 comments on commit 9676d6d

Please sign in to comment.