Skip to content

Commit

Permalink
Assert truthiness to pass type check
Browse files Browse the repository at this point in the history
These will both pass, since we're measuring the box just before.
  • Loading branch information
jridgewell committed Nov 29, 2016
1 parent 446f9be commit c17dacb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions extensions/amp-ad/0.1/amp-ad-3p-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {isAdPositionAllowed, getAdContainer,}
from '../../../src/ad-helper';
import {adConfig} from '../../../ads/_config';
import {getLifecycleReporter} from '../../../ads/google/a4a/performance';
import {user} from '../../../src/log';
import {user, dev} from '../../../src/log';
import {getIframe} from '../../../src/3p-frame';
import {setupA2AListener} from './a2a-listener';
import {moveLayoutRect} from '../../../src/layout-rect';
Expand Down Expand Up @@ -202,7 +202,8 @@ export class AmpAd3PImpl extends AMP.BaseElement {
if (!this.iframeLayoutBox_) {
this.measureIframeLayoutBox_();
}
return moveLayoutRect(this.iframeLayoutBox_, box.left, box.top);
return moveLayoutRect(dev().assert(this.iframeLayoutBox_),
box.left, box.top);
}

/** @override */
Expand Down
5 changes: 3 additions & 2 deletions extensions/amp-iframe/0.1/amp-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {listenFor} from '../../../src/iframe-helper';
import {parseUrl} from '../../../src/url';
import {removeElement} from '../../../src/dom';
import {timerFor} from '../../../src/timer';
import {user} from '../../../src/log';
import {user, dev} from '../../../src/log';
import {utf8EncodeSync} from '../../../src/utils/bytes.js';
import {urls} from '../../../src/config';
import {moveLayoutRect} from '../../../src/layout-rect';
Expand Down Expand Up @@ -237,7 +237,8 @@ export class AmpIframe extends AMP.BaseElement {
if (!this.iframeLayoutBox_) {
this.measureIframeLayoutBox_();
}
return moveLayoutRect(this.iframeLayoutBox_, box.left, box.top);
return moveLayoutRect(dev().assert(this.iframeLayoutBox_),
box.left, box.top);
}

/** @override */
Expand Down

0 comments on commit c17dacb

Please sign in to comment.