New Harmony built-in native objects APIs

Erik Arvidsson erik.arvidsson at gmail.com
Thu Aug 12 14:07:49 PDT 2010


We are starting to define some new built-in native objects for
Harmony. These include, but are not limited to WeakMap, Map and Set. I
just went through the wiki and fixed these 3 so that they behave more
like the built-in native objects in ES5.

I made changes so that the following works as expected:

var m = new Map;
assertTrue(m instanceof Map);
assertTrue(Map.prototype.set instanceof Function);
assertTrue(Map.prototype.get instanceof Function);
assertTrue(Map.prototype.delete instanceof Function);

It seems like ES5 does not define the [[Enumerable]], [[Configurable]]
nor [[Writable]] for the fields on Array.prototype and others like it.
I spec'ed the attributes for all the methods to match ES+Reality. This
means that the methods have {enumerable: false, configurable: true,
writable: true}. This matches what JSC, V8, SpiderMonkey and IE9p4 do.

In the future, it would be good if we could follow the existing
semantics for the built-in natives.

-- 
erik


More information about the es-discuss mailing list