Mirror: The magical sticky regex-based parser generator 🧙
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix up forgotten defaults for interpolations

+12 -11
+12 -11
src/codegen.js
··· 18 18 const abortOnCondition = (condition, hooks) => js` 19 19 if (${condition}) { 20 20 ${restoreIndex(opts.index)} 21 - ${opts.abort} 21 + ${opts.abort || ''} 22 22 } else { 23 - ${opts.onAbort} 23 + ${opts.onAbort || ''} 24 24 } 25 25 `; 26 26 27 27 const astExpression = (ast, depth, opts) => { 28 + const restoreLength = 29 + opts.length && 30 + opts.abort && 31 + js` 32 + ${_node}.length = length_${opts.length}; 33 + `; 34 + 28 35 const abort = js` 29 - ${opts.onAbort} 36 + ${opts.onAbort || ''} 30 37 ${restoreIndex(opts.index)} 31 - ${ 32 - opts.length && opts.abort 33 - ? js` 34 - ${_node}.length = length_${opts.length}; 35 - ` 36 - : '' 37 - } 38 + ${restoreLength || ''} 38 39 ${opts.abort || ''} 39 40 `; 40 41 ··· 97 98 ${restoreIndex(depth)} 98 99 break ${label}; 99 100 } else { 100 - ${opts.onAbort} 101 + ${opts.onAbort || ''} 101 102 } 102 103 `, 103 104 })}