-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Core: Fix JSON.{from,to}_native()
issues
#99765
Core: Fix JSON.{from,to}_native()
issues
#99765
Conversation
93b46a4
to
6036d39
Compare
3791fa1
to
20b2cd8
Compare
Is this ready for review? |
Yes, it's ready. |
20b2cd8
to
bd1a35c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support this and want this merged but I am sick with flu. @AThousandShips can you help review style and such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested but style looks good
I'm curious.
So allow_classes and allow_scripts is merged with allow_objects? Edit: I prefer the granularity |
I think this should be consistent with binary serialization. If we want to add this option here, we should also add it there. |
Is that a lot of trouble? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested briefly locally and it seems to work quite well. The code looks fairly solid to me.
I asked @reduz to have a quick look and he said it looks fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marshalls changes look good
I think we can actually do that, but should go in a separate PR. The hard part is going to be how to handle compatibility with functions exposed to scripting. |
Thanks! |
int
andfloat
.__gdtype
in the case of string-only key dictionaries.RefCounted
handling inmarshalls.cpp
#90693 (premature freeRefCounted
).null
instead of{"__gdtype":"Nil"}
(or it would be{"type":"Nil"}
).int
,float
,String
,StringName
, andNodePath
."i:1"
,"f:1.0"
,"s:abc"
,"sn:abc"
,"np:abc"
.Number
JSON type does not distinguish betweenint
andfloat
.StringName
andNodePath
are used quite often.StringName
in Lua-style dictionaries.Rect2
,Transform2D
, andTransform3D
.args
key, as if it were a constructor or list initializer.allow_classes
andallow_scripts
, use a singleallow_objects
.There were also a few minor "unrelated" improvements along the way:
Variant::get_type_by_name()
, which is the inverse ofVariant::get_type_name()
.marshalls.cpp
already hadContainerType
, which was causing an SCU build error.Test script
Before
If
test.gd
has a global name (class_name
), then this also causes an error:After