Skip to content

minifier: +[false] and +[true] are incorrectly minified #19084

@Joery-M

Description

@Joery-M

I was messing around with jsfuck and found out that oxc_minifier doesn't minify +[false] or +[true] correctly. It is supposed to evalutate to NaN, but Oxc just grabs the boolean and uses that. This makes the 'minified' jsfuck code invalid (not that I'm using jsfuck on a day to day basis)

Original:

const a = +[false]
const b = +[true]

Oxc minified:

const a = 0
const b = 1;

Expected:

const a = NaN
const b = NaN;

Playground (enable minify syntax)

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions