deoxxa
c03dfd35cd
support the non-standard Error.stack property
...
Popular runtimes (V8[1], SpiderMonkey[2], IE[3]) support a `stack`
property on Error objects to get the error's stack as a string.
This change adds support to otto for this same feature. It's implemented
in a similar way to V8, using a getter function. This avoids generating
the stack trace (which is done in a loop with string manipulation etc)
unless the user requests it. There's no standard, or even trend, for the
actual _content_ of `stack`, so we basically just copy what V8's traces
look like.
[1]: https://github.com/v8/v8/wiki/Stack%20Trace%20API
[2]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Error/stack
[3]: http://msdn.microsoft.com/en-us/library/windows/apps/hh699850.aspx
2016-05-02 19:22:56 +10:00
Robert Krimen
ed456945de
Improve error reporting (again)
2014-06-21 21:16:58 -07:00
Robert Krimen
e6768252c2
Improve error reporting
...
* Delay entering global scope on code evaluation, not runtime creation
This fixes #66
2014-06-12 21:27:32 -07:00
Robert Krimen
709a0aa7ff
Value.string(), .float64(), .bool(), etc.
2014-06-06 21:29:40 -07:00
Robert Krimen
918abeb8d8
The zero value of Value is now defined to be undefined
...
Previously, it was a publically accessible but invalid value (valueEmpty).
* Deprecate internal use of UndefinedValue(), NullValue(), FalseValue(), TrueValue()
* Guard against Empty, Result, Reference values from escaping the package
2014-05-28 21:23:32 -07:00
Robert Krimen
ad8a97c028
New parser
...
* Faster, more straightforward, etc.
* More advanced object literals (get ..., set ...)
* More tests using JavaScript from the wild (http://cdnjs.com/ )
2014-04-10 20:42:25 -07:00
Robert Krimen
aef9bfcb9a
Fix "memory leak" by gelcapping panic values with _exception
...
Basically, the Go runtime sees the gelcap shell of the exception,
which dissolves (payload is set to nil) once we catch the error.
This prevents the Go runtime from hanging onto a heavy object for the
panic log (or whatever it is doing with the panic value).
This fixes #59
2014-02-21 18:24:07 -08:00
Robert Krimen
4ebf6416d0
Fix Uint32 Array/String indexing
...
Also, a bunch of toValue_* streamlining
And maybe a few miscellaneous tweaks
2013-06-22 15:49:22 +02:00
Robert Krimen
73bf2f9fa8
Implement return/break/continue without panic/recover
...
This fixes #25
2013-06-13 22:17:04 -07:00
Robert Krimen
d5ced8c71f
Slightly better error return on an uncaught panic
2013-04-20 22:30:27 -07:00
Robert Krimen
20d2e8bba6
gofmt
...
Ugh.
2013-01-25 09:59:42 -08:00
Robert Krimen
30a04e1992
URIError => SyntaxError
2012-11-15 16:06:13 -08:00
Robert Krimen
776f4f96c5
Catch *_syntaxError
2012-10-11 21:44:56 -07:00
Robert Krimen
c6e45a7118
Change getIdentifierReference to accept a node argument
...
To track/report where errors are coming from
2012-10-09 17:26:08 -07:00
Robert Krimen
ade6a169be
Partially fix ReferenceError origin reporting
2012-10-09 17:19:29 -07:00
Robert Krimen
326264ae3e
Line tracking for error reporting
2012-10-09 16:41:45 -07:00
Robert Krimen
4a8c7ffc00
Initial commit
2012-10-05 18:47:53 -07:00