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

Function expressionFunction

docs/tests/v2/es6/js/sanddance.js:130911–130924  ·  view source on GitHub ↗
(name, fn, visitor)

Source from the content-addressed store, hash-verified

130909
130910
130911function expressionFunction(name, fn, visitor) {
130912 if (arguments.length === 1) {
130913 return functionContext[name];
130914 } // register with the functionContext
130915
130916
130917 functionContext[name] = fn; // if there is an astVisitor register that, too
130918
130919 if (visitor) astVisitors[name] = visitor; // if the code generator has already been initialized,
130920 // we need to also register the function with it
130921
130922 if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;
130923 return this;
130924} // register expression functions with ast visitors
130925
130926
130927expressionFunction('bandwidth', _scale.bandwidth, _visitors.scaleVisitor);

Callers 1

sanddance.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected