Thanks to visit codestin.com
Credit goes to github.com

Skip to content

$externalize fails on empty struct. #715

Open
@dmitshur

Description

@dmitshur

Originally reported by @MJKWoolnough in PR #391, this issue is still valid:

Found a bug in how $externalize converts structs to js objects.

It occurs when you have an empty struct, searchJsObject doesn't handle the case where there are no fields to check.

This can be shown by just printing an empty struct{} to the log: -

http://www.gopherjs.org/playground/#/PfMcT_bbbz

The output of that program is:

panic: Cannot read property 'prop' of undefined

Expect it to be no panic, and logging an object without any fields to console.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions