Skip to content

Race condition with this.options in async mode? #477

@ExplodingCabbage

Description

@ExplodingCabbage

It looks to me like the various diffing functions like diffLines each have a single Diff instance they use, and this is stateful - it has an options property that gets overwritten each time you call the diff method. But the diff method can be asynchronous when used with the callback option. That presumably means (I haven't tested yet; will need to create a test case demonstrating this & add it to the test suite) that if you were to call the same diffing method again before the asynchronous execution kicked off by a previous call had finished, you could modify the options seen by the in-progress previous call and thus affect its result.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions