update defineFunction to accept a single arg, introduce flow to do some typechecking

This commit is contained in:
Kevin Barabash
2017-08-19 21:18:12 -04:00
committed by Kevin Barabash
parent a99c7c9e0f
commit d8116bdc64
7 changed files with 174 additions and 131 deletions

View File

@@ -1,8 +1,13 @@
import utils from "./utils";
import ParseError from "./ParseError";
import ParseNode from "./ParseNode";
import {default as _defineFunction, ordargument} from "./defineFunction";
import defineFunction, {ordargument} from "./defineFunction";
// Define a convenience function that mimcs the old semantics of defineFunction
// to support existing code so that we can migrate it a little bit at a time.
const defineFunction = function(names, props, handler) {
_defineFunction({names, props, handler});
};
// A normal square root
defineFunction("\\sqrt", {