Skip to content

Can't dump circular data #110

@ingydotnet

Description

@ingydotnet
> cat circular.js 
x = {};
x.foo = x;
require('js-yaml').dump(x);
> node circular.js 

/home/ingy/src/node_modules/js-yaml/lib/js-yaml/type/timestamp.js:25
match = YAML_TIMESTAMP_REGEXP.exec(object);
                                ^
RangeError: Maximum call stack size exceeded
> 

This is not a contrived use case. I got this trying to dump an http request object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions