siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
28 lines (23 loc) • 506 B
JavaScript
/*
Siesta 5.6.1
Copyright(c) 2009-2022 Bryntum AB
https://bryntum.com/contact
https://bryntum.com/products/siesta/license
*/
Role('Siesta.Util.Role.CanDetectES6', {
has : {
supportsArrowFunctions : function () {
return this.canEvaluate('x => x')
}
},
methods : {
canEvaluate : function (str) {
try {
eval(str)
return true
} catch (e) {
return false
}
}
}
})