Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cramforce committed Jul 1, 2016
1 parent 64c5545 commit 1ce6f02
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/custom-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,16 +640,15 @@ export function createAmpElementProto(win, name, opt_implementationClass) {
}
this.implementation_.layout_ = this.layout_;
this.implementation_.firstAttachedCallback();
} catch (e) {
reportError(e, this);
} finally {
if (!isUpgraded(this)) {
// amp:attached is dispatched from the ElementStub class when it replayed
// the firstAttachedCallback call.
this.dispatchCustomEvent('amp:stubbed');
} else {
this.dispatchCustomEvent('amp:attached');
}
} catch (e) {
reportError(e, this);
}
}
this.resources_.add(this);
Expand Down Expand Up @@ -1249,17 +1248,17 @@ function assertNotTemplate(element) {
};

/**
* @param {!Element} element
* @return {!./service/vsync-impl.Vsync}
* param {!Element} element
*/
function getVsync(element) {
return vsyncFor(element.ownerDocument.defaultView);
};

/**
* Whether the element has been upgraded yet.
* @param {!Element} element
* @return {boolean}
* @final @this {!Element}
*/
function isUpgraded(element) {
return !(element.implementation_ instanceof ElementStub);
Expand Down

0 comments on commit 1ce6f02

Please sign in to comment.