ljharb / es-abstract

ECMAScript spec abstract operations.
MIT License
114 stars 30 forks source link

ES.ToNumber not spec compliant with BigInt input #130

Closed ptomato closed 3 years ago

ptomato commented 3 years ago

According to this ToNumber(1n) should throw a TypeError. Instead the result is 1:

import ToNumber from 'es-abstract/2020/ToNumber';
import assert from 'assert';

assert.throws(() => ToNumber(1n), TypeError);
ljharb commented 3 years ago

Thanks, good catch! Released in v1.18.3.