Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvoytenko committed Jun 24, 2019
1 parent f04221e commit b35eaa5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/friendly-iframe-embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function getFriendlyIframeEmbedOptional(iframe) {
* @param {!HTMLIFrameElement} iframe
* @param {!Element} container
* @param {!FriendlyIframeSpec} spec
* @param {function(!Window, ?./service/ampdoc-impl.AmpDoc)=} opt_preinstallCallback
* @param {function(!Window, ?./service/ampdoc-impl.AmpDoc=)=} opt_preinstallCallback
* @return {!Promise<!FriendlyIframeEmbed>}
*/
export function installFriendlyIframeEmbed(
Expand Down Expand Up @@ -226,7 +226,7 @@ export function installFriendlyIframeEmbed(
iframe[EMBED_PROP] = embed;

// Add extensions.
if (ampdocFieExperimentOn) {
if (ampdoc && ampdocFieExperimentOn) {
extensions.installExtensionsInFie(
ampdoc,
spec.extensionIds || [],
Expand Down
4 changes: 3 additions & 1 deletion src/service/ampdoc-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ export class AmpDocService {
installFieDoc(url, childWin) {
const doc = childWin.document;
devAssert(!doc[AMPDOC_PROP], 'The fie already contains ampdoc');
const frameElement = getParentWindowFrameElement(doc, this.win);
const frameElement = /** @type {!Node} */ (devAssert(
getParentWindowFrameElement(doc, this.win)
));
const ampdoc = new AmpDocFie(childWin, url, this.getAmpDoc(frameElement));
doc[AMPDOC_PROP] = ampdoc;
return ampdoc;
Expand Down
4 changes: 2 additions & 2 deletions src/service/extensions-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export class Extensions {
* but before the first extension is installed.
* @param {!./ampdoc-impl.AmpDocFie} ampdoc
* @param {!Array<string>} extensionIds
* @param {function(!Window, ?./ampdoc-impl.AmpDoc)=} opt_preinstallCallback
* @param {function(!Window, ?./ampdoc-impl.AmpDoc=)=} opt_preinstallCallback
* @return {!Promise}
* @restricted
*/
Expand All @@ -452,7 +452,7 @@ export class Extensions {
* but before the first extension is installed.
* @param {!Window} childWin
* @param {!Array<string>} extensionIds
* @param {function(!Window)=} opt_preinstallCallback
* @param {function(!Window, ?./ampdoc-impl.AmpDoc=)=} opt_preinstallCallback
* @return {!Promise}
* @restricted
*/
Expand Down

0 comments on commit b35eaa5

Please sign in to comment.