Correctly feature detect WeakMap.

This commit is contained in:
Rob 2016-07-01 16:44:16 -07:00
parent 9c7320e26a
commit 5dd4db7676
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ importScripts("/javascripts/lodash.js", "/javascripts/aether.js");
try {
//Detect very modern javascript support.
(0,eval("'use strict'; let test = (class Test { *gen(a=7) { yield yield * () => WeakMap; } });"));
(0,eval("'use strict'; let test = WeakMap && (class Test { *gen(a=7) { yield yield * () => true ; } });"));
console.log("Modern javascript detected, aw yeah!");
self.importScripts('/javascripts/esper.modern.js');
} catch (e) {

View file

@ -66,7 +66,7 @@ self.console = console;
self.importScripts('/javascripts/lodash.js', '/javascripts/world.js', '/javascripts/aether.js');
try {
//Detect very modern javascript support.
(0,eval("'use strict'; let test = (class Test { *gen(a=7) { yield yield * () => WeakMap; } });"));
(0,eval("'use strict'; let test = WeakMap && (class Test { *gen(a=7) { yield yield * () => true ; } });"));
console.log("Modern javascript detected, aw yeah!");
self.importScripts('/javascripts/esper.modern.js');
} catch (e) {