File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
IntegrationTests/JavaScriptKitExec/Sources/JavaScriptKitExec Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,25 @@ Value_Construction: do {
89
89
print ( error)
90
90
}
91
91
92
+ Value_Decoder: do {
93
+ struct GlobalObject1 : Codable {
94
+ struct Prop1 : Codable {
95
+ let nested_prop : Int
96
+ }
97
+ let prop_1 : Prop1
98
+ let prop_2 : Int
99
+ let prop_3 : Bool
100
+ let prop_7 : Float
101
+ }
102
+ let decoder = JSValueDecoder ( )
103
+ let rawGlobalObject1 = getJSValue ( this: . global, name: " globalObject1 " )
104
+ let globalObject1 = try decoder. decode ( GlobalObject1 . self, from: rawGlobalObject1)
105
+ try expectEqual ( globalObject1. prop_1. nested_prop, 1 )
106
+ try expectEqual ( globalObject1. prop_2, 2 )
107
+ try expectEqual ( globalObject1. prop_3, true )
108
+ try expectEqual ( globalObject1. prop_7, 3.14 )
109
+ }
110
+
92
111
Function_Call: do {
93
112
// Notes: globalObject1 is defined in JavaScript environment
94
113
//
You can’t perform that action at this time.
0 commit comments