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

Function checkExpression

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

Source from the content-addressed store, hash-verified

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

Callers 3

checkNodeFunction · 0.70
checkEventFunction · 0.70
checkForFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected