Overriding Map/etc with get/set hooks?

Anne van Kesteren annevk at annevk.nl
Tue May 21 03:09:24 PDT 2013

On Tue, May 21, 2013 at 11:01 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> No, you don't need to do anything differently.  Conceptually, there
> are three things you need:
> 1. When the Map is created, before it's handed to the program, some
> items are added.
> 2. Some platform operations also change this map in addition to doing
> the other things they do.
> 3. Some other set of platform operations consult this map when doing
> their other work.
> Obviously, this is the spec perspective; an implementation could have
> some magic version of the Map that does the update of the internal
> platform state eagerly when map.set() is called.

How does that ensure that e.g.

  map.set("var-" + somethingNotAllowedByCSS, "test")

throws / is ignored (forgot what the desired semantic is)? Or

  map.set("var-test", {toString:function(){return"test")})

returns "test"?


More information about the es-discuss mailing list