nl_tokens: This is the key function for condition coverage as it wraps every condition in a function call . The condition id is generated fron the lineId (
pl_tokens: function wrapCondition ( decision , lineId , parentPos ) { if ( <mask> . condition === false ) { // condition coverage is disabled return decision ; } if ( isSingleCondition ( decision ) ) { var pos = getPositionStart ( decision , parentPos ) ; var condId = lineId + ":" + pos ; analyzing . push ( decision ) ; allConditions . push ( condId ) ; return [ "call" , [ "dot" , [ "name" , "require" ] , "coverage_condition" ] , [ [ "string" , moduleName ] , [ "string" , condId ] , decision ] ] ; } else { decision [ 2 ] = wrapCondition ( decision [ 2 ] , lineId , getPositionStart ( decision , parentPos ) ) ; decision [ 3 ] = wrapCondition ( decision [ 3 ] , lineId , getPositionEnd ( decision , parentPos ) ) ; return decision ; } }