1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00
Commit Graph

32 Commits

Author SHA1 Message Date
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
9297a9abe4
feat: add github action tests and linting (#418)
Leverage github actions for tests and linting.

This includes fixing a bunch of issues highlighted by golangci
including:
* Dead code.
* Ineffectual assigns.
* Goto warnings.
* Nil return err.
* Reused literal strings.
* Test parameter order.

Also:
* Setup clog.
2021-09-27 16:19:28 +01: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
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
470b8c3b73 terst
* Update to latest github.com/robertkrimen/terst
* Clean up testing
2014-04-25 22:48:25 -07:00
Robert Krimen
9561f66959 Tighten test comparisons instead of squashing everything to a string 2014-04-13 18:09:46 -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
029f0bbd63 Fix parseInt if ErrRange occurs (fallback to float64) 2014-04-11 18:05:54 -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
5fe23327c9 Add JSON
This closes #37, #11
2014-02-01 11:32:21 -08:00
Robert Krimen
cf3fad5e7b Remove extra/invalid constructors (inline) 2013-07-20 16:37:57 -07:00
Robert Krimen
aede245ed6 Include property names when inlining 2013-07-20 15:24:56 -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
55565afada Fix global built-in attribute defaults (true, false, true) 2013-06-03 18:36:06 -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
4c85422172 Make encodeURI correspond to the 15.1.3.3 algorithm and encodeURIComponent ito 15.1.3.4 2013-05-02 20:23:06 +02:00
Robert Krimen
83d4565b22 Make decodeURI correspond to the 15.1.3.1 algorithm and decodeURIComponent ito 15.1.3.2 2013-05-02 20:23:06 +02:00
Robert Krimen
b477d8eaed Fix isNaN/isFinite .length & .prototype 2013-04-30 00:18:00 +02:00
Robert Krimen
16030f4b6f Make parseInt behavior correspond to the 15.1.2.3 algorithm 2013-04-30 00:18:00 +02:00
Robert Krimen
b5e40f8a85 Make parseInt behavior correspond to the 15.1.2.2 algorithm 2013-04-28 17:33:00 +02:00
Robert Krimen
2ec9b0843c eval is not a constructor 2013-04-28 11:29:20 +02:00
Robert Krimen
6a4e5a904e eval.prototype === undefined 2013-04-28 11:25:06 +02:00
Robert Krimen
2c4c22ca81 eval.length === 1 2013-04-28 11:24:39 +02: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
9184233705 Bundle terst dependency (github.com/robertkrimen/terst) 2013-04-15 10:20:34 -07:00
Robert Krimen
5a7981beb6 Object, Function, String, TypeError, etc. are not enumerable 2013-02-24 16:21:47 -08:00
Robert Krimen
30dbca3307 NaN, Infinity, undefined, etc. are not be enumerable 2013-02-24 14:28:24 -08:00
Robert Krimen
d297d3c508 Add Number.toString 2013-02-05 11:36:07 -08:00
Robert Krimen
809a0a0ba6 Split tests out of one big massive file 2013-02-05 08:56:08 -08:00
Robert Krimen
20d2e8bba6 gofmt
Ugh.
2013-01-25 09:59:42 -08:00
Robert Krimen
3c93384f5c Cleanup of stash, property, and object
Use octal to designate write/enumerate/configure (experimental)
Move extensibility responsibility into the stash
Rename propertyStash => objectStash (be congruent with arrayStash, etc.)
Get rid of a bunch of useless methods
Privatize everything ([A-Z] => [a-z_])
gofmt
2012-10-26 15:47:19 -07:00
Robert Krimen
4a8c7ffc00 Initial commit 2012-10-05 18:47:53 -07:00