From 97f56a95bdff2aae057e68662ab4a7288ac32d28 Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Wed, 16 May 2018 13:30:15 -0700 Subject: [PATCH] FIX: resolve collision on ember's builtin w string function --- assets/javascripts/discourse/components/google-dfp-ad.js.es6 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 index dc05230..4d8c021 100755 --- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 +++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 @@ -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'),