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

Method ConvertAssignmentExpression

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

Source from the content-addressed store, hash-verified

307 }
308
309 static ConvertAssignmentExpression (n, ctx) {
310 if (n.operator !== '=') throw new Error(`Weird assigment operator ${n.operator}`)
311 if (n.left.type !== 'Identifier') throw new Error('Can only assign to variables')
312
313 return {
314 type: 'variables_set',
315 fields: { VAR: { id: n.left.name } },
316 inputs: {
317 VALUE: { block: convert(n.right, { ...ctx, context: 'value' }) },
318 },
319 }
320 }
321
322 static ConvertBinaryExpression (n, ctx) {
323 const [type, op] = ({

Callers

nothing calls this directly

Calls 1

convertFunction · 0.85

Tested by

no test coverage detected