https://bugzilla.wikimedia.org/show_bug.cgi?id=53241

       Web browser: ---
            Bug ID: 53241
           Summary: Use Map and Set instead of plain objects / ES6 shim
                    cleanup
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: gwi...@wikimedia.org
          Reporter: gwi...@wikimedia.org
                CC: ssas...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

We currently use plain objects in many places where users can pass in keys.
Even with Object.create(null), users can pass in the key '__proto__' which will
happily set the prototype, for example to an object if that is what we set as a
value.

ES6 / harmony Map and Set (see
http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets) fix this
problem (and allow objects as keys), so we should use them. Native Map / Set is
not yet complete in node 0.10, so we should probably use one of the existing
shims to get it:

https://github.com/paulmillr/es6-shim
https://github.com/Benvie/harmony-collections

The es6 shim also gives us more goodies which might be useful to have for
cleaner code. We should not go overboard though, and only use features where a
native implementation is likely to happen soon.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to