Previous version was published with ES6 feature, now the published JS uses ES5 only
- Add support for special characters by using the following :
function validChars(ch) {
return (
(ch >= "a" && ch <= "z") ||
(ch >= "A" && ch <= "Z") ||
ch === "_" ||
ch === "$" ||
"ÀÈÌÒÙàèìòùÁÉÍÓÚáéíóúÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüÿß".indexOf(ch) !== -1
);
}
evaluate = compile("être_embarassé", {
isIdentifierStart: validChars,
isIdentifierContinue: validChars
});
evaluate({ être_embarassé: "Ping" });
- Disallow access to prototype chain (CVE-2020-5219)
- Add support for
this
keyword to write :
evaluate = compile("this + 2")(2); // which gives 4