Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Missing Map type in avm2.js

65 views
Skip to first unread message

zeev.f...@gmail.com

unread,
Jun 15, 2015, 3:10:01 PM6/15/15
to mozilla-d...@lists.mozilla.org
Hi,
I'm testing avm2 by processing xml.abc script:
"js build/ts/shell.js -s -x test/avm2/pass/xml.abc"

As result I've received error message:
"Shumway/build/ts/avm2.js:5310: ReferenceError: Map is not defined"

The line 5310: "this.vectorClasses = new Map();":

========================================================================
5300 /**
5301 * Provides security isolation between application domains.
5302 */
5303 var AXSecurityDomain = (function () {
5304 function AXSecurityDomain() {
5305 initializeAXBasePrototype();
5306 this.system = new AXApplicationDomain(this, null);
5307 this.application = new AXApplicationDomain(this, this.system);
5308 this.classAliases = new AVMX.ClassAliases();
5309 this.nativeClasses = Object.create(null);
5310 this.vectorClasses = new Map();
5311 this._catalogs = [];
5312 }

========================================================================

Maybe someone can advice where Map c-tor is defined (probably some kind of createInterfaceMap() function...) and what can be reason why it's missing in avm2.js scope ?

Best regards,
Ze'ev

Jasper St. Pierre

unread,
Jun 15, 2015, 3:20:05 PM6/15/15
to zeev.f...@gmail.com, mozilla-d...@lists.mozilla.org
Map is part of ES6 and should be in recent SpiderMonkey versions. It
sounds like you're using an old version of js.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
> _______________________________________________
> dev-shumway mailing list
> dev-s...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-shumway



--
Jasper

Till Schneidereit

unread,
Jun 15, 2015, 3:20:17 PM6/15/15
to zeev.f...@gmail.com, mozilla-dev-sh.
Hi Ze'ev,

Map is a new JS builtin, part of ES6:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map

We're targeting bleeding-edge browsers with Shumway, so breakage in older
versions is to be expected. However, you should be able to use one of the
various ES6 polyfill libraries or down-compilers to make things work.

zeev.f...@gmail.com

unread,
Jun 17, 2015, 10:57:07 AM6/17/15
to mozilla-d...@lists.mozilla.org
Hi Till,
Your reference was very useful - I'm planning to test avm2 with V8 JS shell.
According to the link, Chrome supports all mentioned attributes of the Map, although V8 may lack other features added with ES6 and used by Shumway project (Chrome declares support to ES5 specifications: https://code.google.com/p/v8/).

Best Regards,
Ze'ev

Till Schneidereit

unread,
Jun 17, 2015, 11:19:17 AM6/17/15
to Ze'ev Fainberg, mozilla-dev-sh.
Hi Ze'ev,

we do test with at least Chrome Canary pretty regularly. I at least
have "Enable
Experimental JavaScript" enabled in about:flags, though, so that might be
required.

On Tue, Jun 16, 2015 at 9:30 PM, <zeev.f...@gmail.com> wrote:

> Hi Till,
> Your reference was very useful - I'm planning to test avm2 with V8 JS
> shell.
> According to the link, Chrome supports all mentioned attributes of the
> Map, although V8 may lack other features added with ES6 and used by Shumway
> project (Chrome declares support to ES5 specifications:
> https://code.google.com/p/v8/).
>
> Best Regards,
> Ze'ev
>
0 new messages