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

Function checkExpression

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

Source from the content-addressed store, hash-verified

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

Callers 3

checkNodeFunction · 0.70
checkEventFunction · 0.70
checkForFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected