1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00
Commit Graph

30 Commits

Author SHA1 Message Date
Steven Hartland
ddcbf14a26
chore: improve error messages (#482)
Improve error messages so we don't just get TypeError with no clue what
the issue was.
2022-12-07 00:13:42 +00:00
Steven Hartland
026a1d9a9c
chore: lint and naming refactor (#475)
Enable more linters, address the issues and do a major naming refactor
to use golang lower camelCase identifiers for types, functions, methods
and variable names.

Also: 
* Clean up inline generation so it doesn't rely on temporary variables.
* Remove unused functions generated by inline.pl.
2022-12-04 21:49:38 +00:00
Steven Hartland
a3b51c68f2
chore: enable whitespace linter and fix errors (#456)
Enable the whitespace linter and fix the errors resulting from it.

Also:
* Remove unneeded golangci-lint config for disabled linters.
* Correct test number for panic in previous commit.
2022-11-26 13:33:09 +00:00
Conrad Pankoff
b839e7b8bb support methods on go array values 2019-12-15 13:18:22 +11:00
jan-karl
d93f9dce58 test illustrating the issue 2016-10-01 02:50:38 -04:00
deoxxa
fd1eddd0f9 add support for an external Math.random() provider 2016-02-18 22:08:25 +11:00
deoxxa
5a0a713da1 add tests for debugger functionality 2015-12-05 19:27:06 +11:00
deoxxa
7f15b1724e add a way to trigger something with debugger 2015-12-05 19:25:33 +11:00
Robert Krimen
709a0aa7ff Value.string(), .float64(), .bool(), etc. 2014-06-06 21:29:40 -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
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
ea621687a4 Add Otto.Copy() 2013-07-14 14:20:01 -07:00
Robert Krimen
22ae900958 Fix writable/enumerable/configurable of undefined, NaN, & Infinity to be false 2013-06-15 11:27:41 -07:00
Robert Krimen
70045edc65 Fix Function.prototype to have a length property 2013-06-15 11:01:57 -07:00
Robert Krimen
73bf2f9fa8 Implement return/break/continue without panic/recover
This fixes #25
2013-06-13 22:17:04 -07:00
Robert Krimen
506ba2768f Tidy tests (make release, make check, etc.) 2013-06-06 19:57:12 -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
cc112ca544 Set the prototype of the global object to be the object prototype 2013-04-28 11:00:21 +02:00
Robert Krimen
dfa7a59c6f Always declare a function if an identifier is given 2013-04-27 23:00:22 +02:00
Robert Krimen
cfd5635e46 Fix iterator evaluation to return the proper result if a break happens 2013-04-27 22:03:12 +02:00
Robert Krimen
cc243b17d7 Can now attach a label to a block and have it break properly 2013-04-27 15:52:46 +02:00
Robert Krimen
2b3f317e3a Finally should still run even if Catch has break, continue, return, etc. 2013-04-20 21:59:42 -07:00
Robert Krimen
8d09167814 HasInstance should only exist on a Function 2013-04-20 21:41:00 -07:00
Robert Krimen
3f54041eb6 Make sure to evaluate (compare) in the proper order 2013-04-20 19:39:52 -07:00
Robert Krimen
345c4705f9 Improve function declaration: adhere more closely to the specification 2013-04-17 16:13:19 -07:00
Robert Krimen
7d0ac026ea Unary postfix operation: return primitive value, not object (or otherwise) 2013-04-17 10:46:00 -07:00
Robert Krimen
9184233705 Bundle terst dependency (github.com/robertkrimen/terst) 2013-04-15 10:20:34 -07:00
Robert Krimen
d1c4cf79ab Fix always passing in the global object as this for eval
Should be passing in the this of the parent execution context instead
2013-03-05 14:41:50 -08:00
Robert Krimen
809a0a0ba6 Split tests out of one big massive file 2013-02-05 08:56:08 -08:00