Skip to content

Commit

Permalink
Fix conformance violations
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jun 19, 2019
1 parent 28f23c4 commit 5eb9cad
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions build-system/conformance-config.textproto
Expand Up @@ -258,6 +258,7 @@ requirement: {
whitelist: 'src/web-worker/web-worker.js'
# Allowing violations in ads code for now.
# We would have to fix this to property obfuscated the 3p frame code.
whitelist: '3p/iframe-messaging-client.js'
whitelist: 'ads/google/deprecated_doubleclick.js'
whitelist: 'ads/google/imaVideo.js'
}
Expand Down
12 changes: 6 additions & 6 deletions extensions/amp-auto-ads/0.1/anchor-ad-strategy.js
Expand Up @@ -88,19 +88,19 @@ export class AnchorAdStrategy {
* @private
*/
isFilledAnchorAdEnabled_() {
return (this.configObj_['optInStatus'] || []).includes(
OptInStatus.OPT_IN_STATUS_ANCHOR_ADS
);
return user()
.assertArray(this.configObj_['optInStatus'] || [])
.includes(OptInStatus.OPT_IN_STATUS_ANCHOR_ADS);
}

/**
* @return {boolean}
* @private
*/
isNoFillAnchorAdEnabled_() {
return (this.configObj_['optInStatus'] || []).includes(
OptInStatus.OPT_IN_STATUS_NO_FILL_ANCHOR_ADS
);
return user()
.assertArray(this.configObj_['optInStatus'] || [])
.includes(OptInStatus.OPT_IN_STATUS_NO_FILL_ANCHOR_ADS);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions extensions/amp-date-picker/0.1/dates-list.js
Expand Up @@ -80,7 +80,9 @@ export class DatesList {
}
}
const rruleDates = this.rrulestrs_
.map(rrule => rrule.after(date))
.map(rrule => {
return /** @type {!RRule} */ (rrule).after(date, undefined);
})
.filter(Boolean);
firstDatesAfter.concat(rruleDates);

Expand Down Expand Up @@ -138,7 +140,7 @@ export class DatesList {
/**
* Tries to parse a string into an RRULE object.
* @param {string} str A string which represents a repeating date RRULE spec.
* @return {?JsonObject}
* @return {?RRule}
*/
function tryParseRrulestr(str) {
try {
Expand Down
Expand Up @@ -30,9 +30,7 @@ export class AllowedAttributeMutationEntry {
* @return {boolean}
*/
validate(mutationRecord) {
if (mutationRecord['value']) {
return true;
}
return !!mutationRecord['value'];
}

/**
Expand Down
4 changes: 3 additions & 1 deletion extensions/amp-geo/0.1/amp-geo.js
Expand Up @@ -343,7 +343,9 @@ export class AmpGeo extends AMP.BaseElement {
const {classList} = body;
// Always remove the pending class
classesToRemove.push('amp-geo-pending');
classesToRemove.forEach(toRemove => classList.remove(toRemove));
classesToRemove.forEach(toRemove => {
/** @type {!DOMTokenList} */ (classList).remove(toRemove);
});

// add the new classes to <body>
classesToAdd.forEach(toAdd => classList.add(toAdd));
Expand Down
7 changes: 4 additions & 3 deletions extensions/amp-story/1.0/page-advancement.js
Expand Up @@ -541,9 +541,10 @@ class ManualAdvancement extends AdvancementConfig {
*/
isHandledByEmbeddedComponent_(event, pageRect) {
const target = dev().assertElement(event.target);
const inExpandedMode =
this.storeService_.get(StateProperty.INTERACTIVE_COMPONENT_STATE)
.state === EmbeddedComponentState.EXPANDED;
const stored = /** @type {InteractiveComponentDef} */ (this.storeService_.get(
StateProperty.INTERACTIVE_COMPONENT_STATE
));
const inExpandedMode = stored.state === EmbeddedComponentState.EXPANDED;

return (
inExpandedMode ||
Expand Down

0 comments on commit 5eb9cad

Please sign in to comment.