FIX: resolve collision on ember's builtin w string function

This commit is contained in:
Jeff Wong 2018-05-16 13:30:15 -07:00
parent 5d7ced78a6
commit 136cceb1e3
1 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,8 @@ export default Ember.Component.extend({
_initGoogleDFP: function() {
if (!this.get('showAd')) { return; }
const ember_w_function = String.prototype.w;
String.prototype.w = null;
var self = this;
loadGoogle(this.siteSettings).then(function() {
self.set('loadedGoogletag', true);
@ -229,6 +231,8 @@ export default Ember.Component.extend({
window.googletag.pubads().refresh([slot.ad]);
}
});
}).finally(function() {
String.prototype.w = ember_w_function;
});
}.on('didInsertElement'),