Helper is doing something weird to integer arguments

The context is that I’m trying to create a helper that converts bytes into human-readable file sizes. It accepts a single argument- a number of bytes.

I’ve noticed that certain numbers become different or undefined by the time they’re used in the helper. What would be causing this?


{{my-helper 2345234534}} //console.log(params[0]) => 2345234534
{{my-helper 2230000000}} //console.log(params[0]) => 2230000000
{{my-helper 200000000}}  //console.log(params[0]) => 200000000


{{my-helper 1230000001}} //console.log(params[0]) => 156258177
{{my-helper 1230000000}} //console.log(params[0]) => 156258176
{{my-helper 1999999999}} //console.log(params[0]) => undefined
{{my-helper 1000000000}} //console.log(params[0]) => undefined
{{my-helper 2000000000}} //console.log(params[0]) => undefined

Oh I ran into what I think is this same issue recently… I believe it’s a glimmer vm bug with handling integer literals.