putoutjs / minify

Minify with help of 🐊Putout
MIT License
12 stars 3 forks source link

`instanceof` doesn't minify correctly #4

Closed meezwhite closed 1 year ago

meezwhite commented 1 year ago

The following doesn't seem to minify correctly:

class Animal {
  constructor(name) {
    this.name = name;
  }
}

const lion = new Animal('lion');
const isLion = lion instanceof Animal; // <-- this minifies incorrectly

The last line minifies to something like:

// ...
const b = new Animal('lion');
const a = binstanceofAnimal; // <-- missing spaces
coderaiser commented 1 year ago

Thank you! Fixed with https://github.com/putoutjs/printer/commit/2ee5b24b0890bb4a53b90a956ff5e49336216bfe. Landed in @putout/minify@1.17.3 🎉.

Is it works for you?

meezwhite commented 1 year ago

It works, thank you!