MCPcopy Create free account
hub / github.com/microsoft/SandDance / expression

Function expression

docs/tests/v2/es6/js/sanddance.js:131348–131356  ·  view source on GitHub ↗

* Parse an expression given the argument signature and body code.

(args, code, ctx)

Source from the content-addressed store, hash-verified

131346 * Parse an expression given the argument signature and body code.
131347 */
131348function expression(args, code, ctx) {
131349 // wrap code in return statement if expression does not terminate
131350 if (code[code.length - 1] !== ';') {
131351 code = 'return(' + code + ');';
131352 }
131353
131354 var fn = Function.apply(null, args.concat(code));
131355 return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;
131356}
131357/**
131358 * Parse an expression used to update an operator value.
131359 */

Callers 5

operatorExpressionFunction · 0.70
parameterExpressionFunction · 0.70
eventExpressionFunction · 0.70
handlerExpressionFunction · 0.70
encodeExpressionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected