Bug 142709

Summary: Update Map/Set to treat -0 and 0 as the same value
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ggaren, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2015-03-15 00:01:49 PDT
* SUMMARY
MDN says "In earlier versions of the ECMAScript 6 draft -0 and +0 were considered distinct (even though -0 === +0), this has been changed in later versions". JSC is still treating -0 and 0 as distinct keys. Firefox and Chrome treat -0/0 the same. We should update.

ES6 May 14, 2013 Draft ChangeLog notes:
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts
http://wiki.ecmascript.org/doku.php?id=harmony:older_es6_drafts
Added SameValueZero abstraction operation that considers -0 and +0 to be the same value.
SameValueZero is only used by Map/Set operations.
Comment 1 Joseph Pecoraro 2015-03-15 00:04:19 PDT
Created attachment 248675 [details]
[PATCH] Proposed Fix
Comment 2 Csaba Osztrogonác 2015-03-16 08:02:36 PDT
Comment on attachment 248675 [details]
[PATCH] Proposed Fix

LGTM
Comment 3 WebKit Commit Bot 2015-03-16 08:46:29 PDT
Comment on attachment 248675 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 248675

Committed r181556: <http://trac.webkit.org/changeset/181556>
Comment 4 WebKit Commit Bot 2015-03-16 08:46:33 PDT
All reviewed patches have been landed.  Closing bug.