MCPcopy Create free account
hub / github.com/TruthHun/BookStack / checkExpression

Function checkExpression

static/vuejs/vue.esm.js:8925–8939  ·  view source on GitHub ↗
(exp, text, errors)

Source from the content-addressed store, hash-verified

8923}
8924
8925function checkExpression (exp, text, errors) {
8926 try {
8927 new Function(("return " + exp));
8928 } catch (e) {
8929 var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
8930 if (keywordMatch) {
8931 errors.push(
8932 "avoid using JavaScript keyword as property name: " +
8933 "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
8934 );
8935 } else {
8936 errors.push(("invalid expression: " + (text.trim())));
8937 }
8938 }
8939}
8940
8941/* */
8942

Callers 3

checkNodeFunction · 0.70
checkEventFunction · 0.70
checkForFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected