Skip to content
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

BAAS-26309: Only use json stringify for arrays and objects #114

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

tcannon91
Copy link

No description provided.


return val.String()
return e.Error()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base := e.val.baseObject(r)
if base != nil {
switch base.ClassName() {
case "Array", "Object":
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworked this function a bit to only go through json stringify for types that we will have a harder time with in baas. These should also be exceptional (maybe?) if a user were to do something like this:

throw { foo: "bar" };
// or
throw [1, 2, 3];

Not really sure why they would do that but they could and this should stringify so that we can see that value as the "error" in baas

{
description: "Array",
exceptionVal: func() Value {
array := runtime.builtin_newArray([]Value{
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calvin, I tagged you just because I saw your name around Arrays and objects when I was trying to figure out how to construct stuff. Feel free to remove yourself if you don't think this needs a look

Copy link

@jasonrydberg jasonrydberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The tests look good and I'm not concerned about the impact of changes to StringifyError since it's specific to our fork and isn't used anywhere yet.

Copy link

@Calvinnix Calvinnix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀

@tcannon91 tcannon91 merged commit a7b4406 into mongodb-forks:realm Jan 18, 2024
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants