Skip to content

Commit

Permalink
bug fix (#10612)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyx committed Jul 24, 2017
1 parent 8242d89 commit 08ee7cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extensions/amp-analytics/0.1/amp-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,18 @@ export class AmpAnalytics extends AMP.BaseElement {
'amp-analytics config attribute unless you plan to migrate before ' +
'deprecation');
}
const typeConfig = this.predefinedConfig_[type] || {};

this.mergeObjects_(defaultConfig, config);
this.mergeObjects_(typeConfig, config, /* predefined */ true);
if (typeConfig) {
const typeConfig = this.predefinedConfig_[type];
if (!typeConfig) {
// TODO(zhouyx, #7096) Track overwrite percentage. Prevent transport overwriting
if (inlineConfig['transport'] || this.remoteConfig_['transport']) {
const TAG = this.getName_();
user().error(TAG, 'Inline or remote config should not' +
'overwrite vendor transport settings');
}
}

this.mergeObjects_(defaultConfig, config);
this.mergeObjects_((typeConfig || {}), config, /* predefined */ true);
this.mergeObjects_(inlineConfig, config);
this.mergeObjects_(this.remoteConfig_, config);
return config;
Expand Down

0 comments on commit 08ee7cb

Please sign in to comment.