All checks were successful
ci / fast (linux) (push) Successful in 6m23s
Implement ECMA-262 §7.1.1 ToPrimitive/OrdinaryToPrimitive algorithm with valueOf/toString method dispatch, wrapper objects via new Number/String/Boolean, bare-call semantics (Number(42) → primitive), and primitive auto-boxing for method calls like (42).toString(). Updates all operator coercion points (arithmetic, comparison, equality, bitwise, unary, update, compound assignment, template literals) to use ToPrimitive. Promotes 440+ Test262 tests to pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8 lines
193 B
JavaScript
8 lines
193 B
JavaScript
// Number wrapper object and bare call
|
|
var n = new Number(42);
|
|
console.log(typeof n);
|
|
console.log(n + 0);
|
|
console.log(n.valueOf());
|
|
console.log(typeof Number(42));
|
|
console.log(Number("3.14"));
|