Skip to content

Eval error with function and implicit multiplication #1035

@ericman314

Description

@ericman314

I came across a bug in the last example in the docs for implicit multiplication:

math.eval('sqrt(4)(1+2)');   //  TypeError: fn is not a function

The output of console.log(util.inspect(math.parse('sqrt(4)(1+2)'), {depth:100}));

Node {
  fn: 
   Node {
     fn: Node { name: 'sqrt' },
     args: [ Node { value: '4', valueType: 'number' } ] },
  args: 
   [ Node {
       implicit: false,
       op: '+',
       fn: 'add',
       args: 
        [ Node { value: '1', valueType: 'number' },
          Node { value: '2', valueType: 'number' } ] } ],
  comment: '' }

The error occurs in the current develop branch but not the master branch.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions