paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 389 forks source link

Map.prototype.set, WeakMap.prototype.set and Set.prototype.add should be chainable #295

Closed ckknight closed 9 years ago

ckknight commented 9 years ago

Currently the set and add methods return undefined, but as per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-this.add-eset.prototype.add-value, this should be returned.

new Set()
  .add('key')
  .has('key') === true

new Map()
  .set('key', 'value')
  .get('key') === 'value'
ljharb commented 9 years ago

Fixed and released in v0.19.1