archives

« Bugzilla Issues Index

#2496 — "same" is determined but not used in Map.prototype.set


> 6. If M’s [[MapComparator]] internal slot is undefined, then let same be
> the abstract operation SameValueZero.
> 7. Else, let same be the abstract operation SameValue.
> 8. Repeat for each Record {[[key]], [[value]]} p that is an element of
> entries,
> a. If SameValueZero(p.[[key]], key), then
> i. Set p.[[value]] to value.
> ii. Return M.

8.a. should say "If same(...)" not "If SameValueZero(...)".


Actually, I believe that [[MapComparator]] is being removed from the spec. So steps 6 and 7 should just be deleted.


I didn't know that! Excellent!


(In reply to comment #2)
> I didn't know that! Excellent!

right, the second argument to the constructors was removed at (I think) the Nov. TC39 meeting.

If somebody wants to have a Map/set that distingishes -0 they can easily create a subclass that does that.