mevento 1.9.5 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2015/mevento.mjs
CHANGED
|
@@ -1400,7 +1400,7 @@ class MEvento extends NodeVisitor {
|
|
|
1400
1400
|
const callee = node.callee;
|
|
1401
1401
|
const args = node.arguments;
|
|
1402
1402
|
const calleeName = callee.value;
|
|
1403
|
-
const fn = this.
|
|
1403
|
+
const fn = this.resolveFunction(calleeName);
|
|
1404
1404
|
const argValues = args.map((e) => this.visit(e));
|
|
1405
1405
|
// print("argValues::", argValues)
|
|
1406
1406
|
return fn === null || fn === void 0 ? void 0 : fn(argValues, this);
|
|
@@ -1660,6 +1660,13 @@ class MEvento extends NodeVisitor {
|
|
|
1660
1660
|
return this.visit(it);
|
|
1661
1661
|
});
|
|
1662
1662
|
}
|
|
1663
|
+
setFunctionResolver(resolver) {
|
|
1664
|
+
this._functionResolver = resolver;
|
|
1665
|
+
}
|
|
1666
|
+
resolveFunction(name) {
|
|
1667
|
+
var _a, _b;
|
|
1668
|
+
return (_a = this._functionsRegistry[name]) !== null && _a !== void 0 ? _a : (_b = this._functionResolver) === null || _b === void 0 ? void 0 : _b.call(this, name);
|
|
1669
|
+
}
|
|
1663
1670
|
registerFunction(id, fn) {
|
|
1664
1671
|
this._functionsRegistry[id] = fn;
|
|
1665
1672
|
}
|