giving up on NaN, with one patch

Brandon Benvie bbenvie at
Tue Mar 26 19:44:46 PDT 2013

On 3/26/2013 7:19 PM, Sam Tobin-Hochstadt wrote:
> On Tue, Mar 26, 2013 at 10:15 PM, David Herman <dherman at> wrote:
>> ## Fix 2: Patch the semantics of writing non-writable properties
>> I agree with Sam that writing to a non-writable property is silly. We can fix the semantics so that it doesn't actually modify the value if SameValue holds. The only observable difference should be this NaN issue, which is what we wanted to fix in the first place.
>> I'm fine with either fix, but note that if we go with Fix 2, there's a finer distinction in the language than SameValue.
> Jeff Walden pointed out that the semantics don't actually have this
> bug -- see the ValidateAndApplyPropertyDescriptor algorithm, which
> doesn't update in the SameValue case.
Indeed, and my earlier test showed that V8, in fact, does not change the 
value of an immutable property given two different NaNs (silently 
ignores the attempt to change). As I said, in V8 it IS possible to hide 
values in NaNs, but this doesn't violate any invariants.

More information about the es-discuss mailing list