Last active
October 21, 2023 17:26
-
Star
(225)
You must be signed in to star a gist -
Fork
(30)
You must be signed in to fork a gist
-
-
Save DaBs/89ccc2ffd1d435efdacff05248514f38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} | |
/* | |
* All credits to Netflix for providing this approach to ES6 feature detection. Although this could be written in many different ways | |
* this proved to be the most direct and elegant approach for me. | |
* License: MIT | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It also rises a parse error in IE 11
Expected hexadecimal digit
, and thus fails its purpose.