diff --git a/packages/babel-plugin-minify-constant-folding/src/index.js b/packages/babel-plugin-minify-constant-folding/src/index.js index 782d76be2..9f09489f2 100644 --- a/packages/babel-plugin-minify-constant-folding/src/index.js +++ b/packages/babel-plugin-minify-constant-folding/src/index.js @@ -22,7 +22,7 @@ function swap(path, member, handlers, ...args) { const key = getName(member); if (key === undefined) return; let handler = handlers[key]; - if (typeof handler !== "function") { + if (typeof handler !== "function" || !Object.hasOwnProperty.call(handlers, key)) { if (typeof handlers[FALLBACK_HANDLER] === "function") { handler = handlers[FALLBACK_HANDLER].bind(member.object, key); } else {