Skip to content

Commit

Permalink
Should fix babel#576
Browse files Browse the repository at this point in the history
People were calling `"foo".toString() or ["foo", "bar"].toString()`, which returned the real JS string `"[object Object]"`, the stringified version of the replacements object.
  • Loading branch information
j-f1 committed Jun 16, 2017
1 parent ba29bc5 commit d8c30c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-plugin-minify-constant-folding/src/index.js
Expand Up @@ -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 {
Expand Down

0 comments on commit d8c30c2

Please sign in to comment.