Fix the way tester works, move it into the tools directory and clean up
how it processes files including adding more data to the summary about
what failed and why.
Remove the dependencies on perl and make.
inline.pl is replaced by tools/gen-jscore and token/tokenfmt is replaced
by tools/gen-tokens which are both golang text/template utilities.
gen-jscore uses property ordering that matches chromes output ordering
adding missing properties to the Error types.
Local generated documentation have been removed as https://pkg.go.dev/
is more feature rich.
The use of make has been removed as the functionality is now replicated by
standard golang tools go test ./... and go generate ./... as well as integrated
into github actions.
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.
Fix toInt32, toUint32 conversions which caused test failures on arm64 by
leveraging the power of go casts to simplify the conversion from float64
to integer types.
Update underscore.js to v1.13.6.
BREAKING CHANGE: This changes the behaviour for the following underscore
functions, please see underscore.js documentation for details.
* .template
* .keys
* .after
* .range
* .reduce
* .reduceRight
* .reduceLeft
Fixes#110
Fix the example to clean up watchdog goroutine after either the timeout or the VM completes.
Co-authored-by: Steven Hartland <steven.hartland@multiplay.co.uk>
When putting JavaScript objects into _go*object use exported values.
This reverts PR #467 in favour of this more complete work.
Fixes#118#252
Co-authored-by: Dmitry Panov <dop@itoolabs.com>
While not specified in the ECMA specification the current index has been
typed as number by others, so match this instead of passing as string.
Fixes#177
Use time.UnixMilli instead of UnixNano for time calculations to avoid
underflow / overflow issues.
BREAKING CHANGE: Use a GMT fixed time zone for UTC to mimic toUTCString
behaviour of Javascript which outputs in GMT not UTC.
Fixes#302
In nested do-while statements, a semicolon after the inner `while` threw
a parsing error. This change checks for the optional semicolon.
Co-authored-by: Brian Graham <bcgraham+github@gmail.com>
Add support for direct use of push to go slices without converting to
array using .slice().
Fixes#357
Also:
* Add classGoSlice and use it, to make it clear the type when debugging.
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.
Fix array writes not being persisted by passing in writeable
reflect.Value when available instead of .Interface() which looses that
property.
Also:
* Use value.IsValid() instead of comparison with zero entry.
* Use propertyLength instead of literal.
Fixes#386
Allow pointers to structs in fieldIndexByName.
Also:
* Use reflect.Type.Elem() vs reflect.ValueOf(t).Elem().Type().
* Format bug_test.go to fix lint failure.
Remove skip-cache: true and restore skip-pkg-cache: true and
skip-build-cache: true so that we still cache golangci-lint results
which skip-cache: true disables.
Use setup-go caching instead of manually rolled version.
Also:
* Bump golangci-lint to 1.50.1.
* Add go 1.19 to test / lint matrix.
* Bump timeout to 6 mins.
Update github.com/chzyer/logex to v1.2.1 which has an explicit
LICENSE file to prevent package without alarming compliance
tools.
Signed-off-by: eriknordmark <erik@zededa.com>
Value and Object now conform to the json.Marshaler interface and produce the
correct JSON when passed (directly or indirectly) to json.Marshal().
Before, both types would marshal as "{}" because they're structs with no public
fields.
This fixes some nasty problems marshaling object trees that mix Go and JS
collections. This can happen when you pass a Go collection into a JS function,
which modifies it adding JS values; and then back in Go you marshal the
collection to JSON. Before this commit the JS values would marshal to "{}".
(The new unit test TestNestedJSONMarshaling demonstrates this.)
Fixes#262
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.
Prevent loop statements with no body hanging forever
Co-authored-by: Stefano Fratini <stefano.fratini@nnnco.com.au>
Co-authored-by: tkpd-richard-putra <83326962+tkpd-richard-putra@users.noreply.github.com>
Adds basic non ascii support including substring, substr, slice functions,
which work with runes (prevent utf-8 length).
This includes adding runes compatible functions:
* indexOf
* lastIndexOf
Fix a panic in value export when an array has multiple types of arrays.
This takes into account the types of elements in sub arrays, slices, etc.
Fixes#279Fixes#377