Skip to content

A platform for community discussion. Free, open, simple.

DEV: don't define `_super` when modifying widgets unless the property is a function (#8042)

Osama Sayegh2305a6fffe28
diff --git a/app/assets/javascripts/discourse/widgets/widget.js.es6 b/app/assets/javascripts/discourse/widgets/widget.js.es6
index 004cce469d2..6888d662095 100644
--- a/app/assets/javascripts/discourse/widgets/widget.js.es6
+++ b/app/assets/javascripts/discourse/widgets/widget.js.es6
@@ -79,7 +79,7 @@ export function reopenWidget(name, opts) {
Object.keys(opts).forEach(k => {
let old = existing.prototype[k];
- if (old) {
+ if (old instanceof Function) {
// Add support for `this._super()` to reopened widgets if the prototype exists in the
// base object
existing.prototype[k] = function(...args) {