MCPcopy Create free account
hub / github.com/codecombat/codecombat / ConvertArrayExpression

Method ConvertArrayExpression

app/lib/code-to-blocks.js:144–155  ·  view source on GitHub ↗
(n, ctx)

Source from the content-addressed store, hash-verified

142 }
143
144 static ConvertArrayExpression (n, ctx) {
145 const found = findOne(ctx.plan, x => fuzzyMatch(n, x[1]), 'Can\'t find the array expression')
146 const o = {
147 type: found[0].type,
148 extraState: { itemCount: n.elements.length },
149 inputs: {},
150 }
151 for (let i = 0; i < n.elements.length; ++i) {
152 o.inputs['ADD' + i] = { block: convert(n.elements[i], { ...ctx, context: 'value' }) }
153 }
154 return o
155 }
156
157 static ConvertWhileStatement (n, ctx) {
158 const found = findOne(ctx.plan, x => fuzzyMatch(n, x[1]), 'Can\'t find the while statement')

Callers

nothing calls this directly

Calls 3

findOneFunction · 0.85
fuzzyMatchFunction · 0.85
convertFunction · 0.85

Tested by

no test coverage detected