Ignore errors when converting a property name to the key type for goMapObject
during a getOwnProperty operation, as a property which fails conversion to the
target's key type could not possibly be a member of it.
fixes#488
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.
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>
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
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
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.
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
this allows you to export a javascript Value back
for use in go. the result structure should be the
same as if you serialized to JSON in javascript
and then Unmarshal'd those bytes in go