Skip to content

Do not cause an error when trying to stringify a NativeError. #201

@gbrail

Description

@gbrail

This is currently the bug:

$ rhino
Rhino 1.7.6 2015 04 15
js> try { somethingundefined(); } catch (e) { JSON.stringify(e); }
js: Java class "[B" has no public instance field or method named "toJSON".

With the fix, the proper behavior is this:

Rhino 1.7.7 2015 06 17
js> try { somethingundefined(); } catch (e) { JSON.stringify(e); }
{"message":""somethingundefined" is not defined.","fileName":"","lineNumber":2}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions