ianchi/ESpression

A better error message when accessing missing methods

Closed this issue · 3 comments

https://ianchi.github.io/ESpression-tester/
Context

{"a": 1}

Expression

a.match()

Parsed AST

 "can't access property \"apply\", s is undefined"

Two problems:

  1. It would be nice to have a better error message e.g. can't call function, a.match is undefined.
  2. Why changing context would affect parsed AST? I thought it is only used while evaluating the expression.

Also other null-accessing errors e.g. null[0], null.a.

Hi, effectively the context doesn't affect the parsing.
This is an error on the tester app, that is showing the eval error on the AST textbox.
I'll fix it asap.

Updated ESpression-tester app, and slightly improved error message