Skip to content

Incorrect Side effect free optimizations: BigInt(x) and Regex with certain literals #7916

@TheAlexLichter

Description

@TheAlexLichter
const a = BigInt(1.5)
const b = BigInt(NaN)
const c = BigInt(Infinity)
const d = BigInt(-Infinity)
const e = BigInt("abc")
const f = RegExp("[")
const g = RegExp("a", "xyz")

These should all throw errors and in turn have side effects.

Related: #6897

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions