Skip to content

Commit 5d0f3fb

Browse files
squatsbarzowski
authored andcommitted
builtins.go: fix builtinManifestJSONEx regression
This commit fixes a regression in std.manifestJsonEx that caused the standard library function to error when the given value was an array. Signed-off-by: Lucas Servén Marín <[email protected]>
1 parent f742f24 commit 5d0f3fb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

builtins.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,10 +1211,7 @@ func jsonEncode(v interface{}) (string, error) {
12111211
// For backwards compatibility reasons, we are manually marshalling to json so we can control formatting
12121212
// In the future, it might be apt to use a library [pretty-printing] function
12131213
func builtinManifestJSONEx(i *interpreter, arguments []value) (value, error) {
1214-
obj, err := i.getObject(arguments[0])
1215-
if err != nil {
1216-
return nil, err
1217-
}
1214+
val := arguments[0]
12181215

12191216
vindent, err := i.getString(arguments[1])
12201217
if err != nil {
@@ -1315,7 +1312,7 @@ func builtinManifestJSONEx(i *interpreter, arguments []value) (value, error) {
13151312
}
13161313
}
13171314

1318-
finalString, err := aux(obj, path, "")
1315+
finalString, err := aux(val, path, "")
13191316
if err != nil {
13201317
return nil, err
13211318
}

0 commit comments

Comments
 (0)