MCPcopy Create free account
hub / github.com/ygs-code/vue / checkFor

Function checkFor

vue.js:15394–15409  ·  view source on GitHub ↗
(node,  //节点
        text,  //for的text    "(itme,index) in list"
        errors //错误信息
    )

Source from the content-addressed store, hash-verified

15392
15393 //检查 for
15394 function checkFor(node, //节点
15395 text, //for的text "(itme,index) in list"
15396 errors //错误信息
15397 ) {
15398
15399 //检查字符串 转成真正的js的时候是否会报错
15400 checkExpression(node.for || '', text, errors);
15401
15402 //检查 new Function(("var " + ident + "=_")); 是否会报错 相当于 var str = _;
15403 checkIdentifier(node.alias, 'v-for alias', text, errors);
15404
15405 checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
15406
15407 checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
15408
15409 }
15410
15411 //检查var a ='_' 或者 检查var a =_ 是否会报错 new function 用来检测js错误 与eval差不多
15412 function checkIdentifier(ident, //识别

Callers 1

checkNodeFunction · 0.85

Calls 2

checkExpressionFunction · 0.85
checkIdentifierFunction · 0.85

Tested by

no test coverage detected