Closed IsaacOscar closed 5 years ago
This is a good suggestion. There is already a JavaScript function in gracelib.js called describe
that attempts to build a useful description of an arbitrary Grace object. Do you think that it should add the definition module and line number? This function could then be called from raiseTypeError
.
The master version of gracelib.js is in the js directory. The other copies are made as part of the build process.
Solved by 79adeec9b8eee0a9472c9b6329202408916f6ec9
Error messages given for type errors are not very usefull, e.g:
This dosn't tell me what it is that
was passed tothe foo(_) method is trying to return.I have "fixed" this by adding the indicated line to "/usr/lib/grace/modules/gracelib.js":
I havn't added it to the source code as there are 9 files definining that function, and I don't know which is the appropriate one to modify.
Now it will also print
Indicating "what" the object is (i.e. a Baz). This is very helpfull for debugging grace programs!