Fixed function being replaced with object['value'] accessors
This commit is contained in:
@@ -1,7 +1,17 @@
|
|||||||
import * as math from 'mathjs';
|
import * as math from 'mathjs';
|
||||||
|
|
||||||
export default function replaceBareSymbolsWithValueAccessor(node, path) {
|
export default function replaceBareSymbolsWithValueAccessor(node, path) {
|
||||||
if (node.isSymbolNode && path !== 'object') {
|
if (node.isFunctionNode){
|
||||||
|
let fn = node.fn;
|
||||||
|
if (fn && fn.isSymbolNode){
|
||||||
|
fn.skipReplacement = true;
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
} else if (
|
||||||
|
node.isSymbolNode &&
|
||||||
|
path !== 'object' &&
|
||||||
|
node.skipReplacement !== true
|
||||||
|
) {
|
||||||
const object = new math.SymbolNode(node.name);
|
const object = new math.SymbolNode(node.name);
|
||||||
const address = new math.ConstantNode('value');
|
const address = new math.ConstantNode('value');
|
||||||
const index = new math.IndexNode([address]);
|
const index = new math.IndexNode([address]);
|
||||||
|
|||||||
Reference in New Issue
Block a user