Skip to content

Should warp10 throw an error when it tries to serialize a function? #3

@patrick-steele-idem

Description

@patrick-steele-idem

We are using warp10 to serialize data down from the server to the browser. Currently, warp10 will silently discard functions/methods on objects (this includes methods on the prototype chain). This leads to weird issues such as "Method not found" in the browser. In theory, in development we could check to see if this is happening and throw an error without incurring a runtime cost in production. Going this route would require introducing a build step for warp10 to support two different code paths (one for development and one for production). Possibly introduce a checkForFunctions() at the following line: https://github.com/patrick-steele-idem/warp10/blob/75a390910a563c7b1a60057c8177b4b0d61a05a5/src/stringifyPrepare.js#L83

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions