diff --git a/common/remote_object.go b/common/remote_object.go index c63dd1e03..a22873cc8 100644 --- a/common/remote_object.go +++ b/common/remote_object.go @@ -287,6 +287,9 @@ func parseConsoleRemoteObjectValue( } case cdpruntime.TypeObject: if op != nil { + if st == "array" { + return parseConsoleRemoteArrayPreview(logger, op) + } return parseConsoleRemoteObjectPreview(logger, op) } if val == "Object" { diff --git a/tests/remote_obj_test.go b/tests/remote_obj_test.go index abbf20a0a..519544757 100644 --- a/tests/remote_obj_test.go +++ b/tests/remote_obj_test.go @@ -30,7 +30,7 @@ func TestConsoleLogParse(t *testing.T) { name: "bool", log: "true", want: "true", }, { - name: "empty_array", log: "[]", want: "{}", // TODO: Improve this output + name: "empty_array", log: "[]", want: "[]", }, { name: "empty_object", log: "{}", want: "{}", @@ -39,7 +39,7 @@ func TestConsoleLogParse(t *testing.T) { name: "filled_object", log: `{"foo":{"bar1":"bar2"}}`, want: `{"foo":"Object"}`, }, { - name: "filled_array", log: `["foo","bar"]`, want: `{"0":"foo","1":"bar"}`, + name: "filled_array", log: `["foo","bar"]`, want: `["foo","bar"]`, }, { name: "filled_array", log: `() => true`, want: `function()`,