-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed attributes in objects are not Export()ed #252
Comments
stevenh
added a commit
that referenced
this issue
Nov 28, 2022
When exporting a map check for values which are otto.Value and process them. This is a one level export and no additional traversal is done. Fixes #252
Merged
stevenh
added a commit
that referenced
this issue
Nov 28, 2022
When exporting a map check for values which are otto.Value and process them. This is a one level export and no additional traversal is done. Fixes #252
stevenh
added a commit
that referenced
this issue
Nov 28, 2022
sg3des
pushed a commit
to sg3des/otto
that referenced
this issue
Jul 17, 2023
When exporting a map check for values which are otto.Value and process them. This is a one level export and no additional traversal is done. Fixes robertkrimen#252
sg3des
pushed a commit
to sg3des/otto
that referenced
this issue
Jul 17, 2023
When putting JavaScript objects into _go*object use exported values. This reverts PR robertkrimen#467 in favour of this more complete work. Fixes robertkrimen#118 robertkrimen#252 Co-authored-by: Dmitry Panov <dop@itoolabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following use case, around templating: take an object which comes from JSON (i.e.,
map[string]interface{}
etc.), pass it to some Javascript code, receive the maybe changed object, and JSON it back again.The following test case illustrates what I do, and what I see as the failure when I do that:
I would expect the test to pass, but the first check fails:
Here the changed
attr
is anotto.Value
where I would have expected a[]interface{}
(or possibly slice of string or something). The next case, the JSON serialization:The slice here is gone and replaced by an empty object. Note that the serialization itself didn't fail, which is also an error in itself...
The text was updated successfully, but these errors were encountered: