Skip to content
Snippets Groups Projects
Commit cdd91e28 authored by Ujjwal Sharma's avatar Ujjwal Sharma Committed by Rick Waldron
Browse files

Improve ToNumber test for NumberFormat.format

parent 7a87bde2
No related branches found
No related tags found
No related merge requests found
......@@ -25,11 +25,16 @@ const toNumberResults = [
const nf = new Intl.NumberFormat();
toNumberResults.forEach(pair => {
const value = pair[0];
const result = pair[1];
const [value, result] = pair;
assert.sameValue(nf.format(value), nf.format(result));
});
let count = 0;
const dummy = {};
dummy[Symbol.toPrimitive] = hint => (hint === 'number' ? ++count : NaN);
assert.sameValue(nf.format(dummy), nf.format(count));
assert.sameValue(count, 1);
assert.throws(
TypeError,
() => nf.format(Symbol()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment