| 143255 | return fn; |
| 143256 | } // Register an expression function |
| 143257 | function expressionFunction(name, fn, visitor) { |
| 143258 | if (arguments.length === 1) return functionContext[name]; |
| 143259 | // register with the functionContext |
| 143260 | functionContext[name] = fn; // if there is an astVisitor register that, too |
| 143261 | if (visitor) astVisitors[name] = visitor; // if the code generator has already been initialized, |
| 143262 | // we need to also register the function with it |
| 143263 | if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name; |
| 143264 | return this; |
| 143265 | } // register expression functions with ast visitors |
| 143266 | expressionFunction("bandwidth", bandwidth, scaleVisitor); |
| 143267 | expressionFunction("copy", copy, scaleVisitor); |
| 143268 | expressionFunction("domain", domain, scaleVisitor); |