Re: Proxy objects and collection

2014-09-04 Thread Jason Orendorff
On Tue, Sep 2, 2014 at 1:07 PM, Daurnimator q...@daurnimator.com wrote: I'm the maintainer of lua.vm.js[1], which allows Lua code to run in the browser. I've managed to construct a simple and robust cross-language bridge, so that Lua code can interact with Javascript objects. When the Lua no

Set#toString and Map#toString

2014-09-04 Thread C. Scott Ananian
Neither `Set` nor `Map` have `toString` methods defined on the prototype. This can lead to somewhat surprising behavior for interactive users (this is node with`es6-shim`): ```js s = new Set(['a']) {} m = new Map([['a','b']]) {} s.toString() '[object Object]' m.toString() '[object Object]'

Re: Set#toString and Map#toString

2014-09-04 Thread Allen Wirfs-Brock
ES6 defines `Map.prototype[Symbol.toStringTag]` and `Set.prototype[Symbol.toStringTag]` such that the ES6 version of Object.prototype.toString will produce [object Map] and [object Set] respectively when applied to Map or Set instances Allen On Sep 4, 2014, at 2:51 PM, C. Scott Ananian

Re: Set#toString and Map#toString

2014-09-04 Thread Boris Zbarsky
On 9/4/14, 5:51 PM, C. Scott Ananian wrote: s.toString() '[object Object]' Per spec this should be [object Set]. Both V8 and SpiderMonkey get this right, fwiw. m.toString() '[object Object]' Again, should be [object Map]. Eventually node's `util.inspect` (and the various browser