Robert Krimen
47082f4308
Look for less than 0, not just -1
...
This fixes #116
2015-06-10 22:48:44 -07:00
Robert Krimen
dea31a3d39
Fix behavior when breaking a loop into an outer block
...
This fixes #87
2014-07-02 21:33:53 -07:00
Robert Krimen
709a0aa7ff
Value.string(), .float64(), .bool(), etc.
2014-06-06 21:29:40 -07:00
Robert Krimen
b813fe3676
Fix JSON.stringify treating large integers as float64
...
This fixes #80
2014-06-06 21:08:59 -07:00
Robert Krimen
6c7c425424
Fix toReflectValue to handle Struct, Map, Slice, etc.
...
This fixes #79
2014-06-04 18:08:42 -07:00
Robert Krimen
9cd045ef04
Simplification & refactor of (parts of) the runtime
...
* Proper lowercasing for internal stuff
* *Environment => *_stash
* ExecutionContext => _scope
* Simpler & shallower call/construct mechanics
* Remove unnecessary fields & methods
* Better scoping (no more stack): []*_scope => _scope.outer
* Some speed improvements
In preparation for #66
2014-05-27 22:05:35 -07:00
Robert Krimen
b7dd9df181
Fix array-like handling in JSON.stringify
...
This fixes #73
2014-05-24 10:05:10 -07:00
Robert Krimen
ba678bc782
Use _runtime.toValue() instead of func toValue()
...
This fixes #72
2014-05-22 20:39:27 -07:00
Robert Krimen
470b8c3b73
terst
...
* Update to latest github.com/robertkrimen/terst
* Clean up testing
2014-04-25 22:48:25 -07:00
Robert Krimen
bf7b16f4a3
Add internal compilation step
...
* Streamline what we get from "otto/parser"
* Get rid of some "otto/parser" cruft
* FunctionExpression => FunctionLiteral
* The debugger statement (debugger) should do nothing (not panic)
* Fix aspects of function expression call evaluation
2014-04-19 14:05:51 -07:00
Robert Krimen
7163cd7841
Skip unexported fields, begin json.Marshaler support
...
* The "reflect" package is willing to expose unexported fields in structs (a little suprising).
* Skip unexported fields when enumerating or trying to access (pretend they don't exist).
* Allow structs that implement json.Marshaler to work as expected in a JSON.stringify call.
If we let the runtime try to access unexported fields, it'll cause a panic.
This fixes #64
2014-04-12 11:53:04 -07:00
Robert Krimen
6e3ed1b99d
Tighten test comparisons instead of squashing everything to a string
2014-04-11 18:06:18 -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
Tim Jurcka
805a4c27b1
Fix redundant evaluation of test in "for" (sdgoij/MatrixFrog)
...
This fixes #39
2014-01-19 09:08:47 -08:00
Robert Krimen
42d674a81b
Embiggen test for #24
...
Make sure we get back out what we put in.
2013-06-09 18:58:35 -07:00
Robert Krimen
30e4c4b96d
Fix .ToValue([]string{...}).Export() to return []string{...}
...
This fixes #24
2013-06-06 20:18:37 -07:00
Robert Krimen
04ea4a2729
Prevent otto.Value from becoming a _goStructObject
...
Fix #21 , this would happen during .Set(...)
2013-06-05 21:52:59 -07:00
Robert Krimen
7e2b4f2063
Rewrite of property handling to be more robust and compliant
...
* No more _stash
* Now using a "virtual table" system via _objectClass
* Make Array.concat GoArray compatible (via .isArray())
Fix #16
2013-05-12 14:14:51 -07:00
Robert Krimen
149f94f9fb
Fix that we were using a non-runtime toValue method with go_array, go_map, and go_struct
...
This will fix #13
2013-04-30 00:36:46 +02:00
Robert Krimen
9184233705
Bundle terst dependency (github.com/robertkrimen/terst)
2013-04-15 10:20:34 -07:00
Robert Krimen
260b2a48bf
Fix (band-aid) Go/JavaScript cross-boundary error transformation
2013-03-06 12:07:26 -08:00
Robert Krimen
d0132833fb
SyntaxError => ReferenceError
2013-03-06 11:58:39 -08:00
Robert Krimen
20d2e8bba6
gofmt
...
Ugh.
2013-01-25 09:59:42 -08:00
Robert Krimen
7982fa0fac
Fix scanning \r, \b, \f, \v as \t
...
Copy and paste error of epic proportions?
This will fix #5
2012-10-17 18:57:48 -07:00