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

14 Commits

Author SHA1 Message Date
Steven Hartland
7009038f79
fix: linting errors (#441)
Disable new linters which aren't compatible with this code module.

Upgrade github actions to fix caching issues.

Run go mod to bring in new styling.

Remove space on nolint declarations.

Apply all changes to whitespace as required to pass goimports linter.

Only trigger checks on pull_request which works for pulls from other
forks, where as push only works from the same repo.
2022-10-08 00:12:19 +01: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
Steven Hartland
40ef8d9463 Fix argument processing for call
Fix toValueArray causing "missing runtime" errors due to use of toValue instead of self.toValue which causeed issues with passing values to Otto.Call(...).
2015-02-12 15:11:55 +00: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
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
Tim Jurcka
5fe23327c9 Add JSON
This closes #37, #11
2014-02-01 11:32:21 -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
bf322e56ee Fix subtle range bug in String.substring (uint => int64)
Was looking for negative in the following calculation:

uint(0) - uint(3) => uint(0)
2013-02-20 16:24:01 -08:00
Robert Krimen
4e4e89c894 Fix bug in String.slice with a (go) slice bounds violation
Basically, check that start is less than length before trying
to take a slice.

Also, rename valueToArrayIndex to valueToRangeIndex to reflect
the fact that it does not always return a value that is valid
index (value could be length)
2013-02-20 15:58:43 -08:00
Robert Krimen
a879744c20 Add Go <=> JavaScript type interaction
Via reflection for struct, map, and slice/array
Fix #10
2013-02-04 10:31:44 -08:00
Robert Krimen
20d2e8bba6 gofmt
Ugh.
2013-01-25 09:59:42 -08:00
Robert Krimen
9385f32241 Fix substring to have correct behavior 2012-11-06 20:03:22 -08:00
Robert Krimen
4a8c7ffc00 Initial commit 2012-10-05 18:47:53 -07:00