Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot override isClean #16

Open
rrthomas opened this issue Mar 17, 2024 · 3 comments
Open

Cannot override isClean #16

rrthomas opened this issue Mar 17, 2024 · 3 comments

Comments

@rrthomas
Copy link

rrthomas commented Mar 17, 2024

When I override isClean in a subclass of StackTracey, the original method is called instead.

This does not happen with isThirdParty, which I can override no problem: indeed, my override of isThirdParty is correctly called by the original isClean.

I believe this problem arises because mergeRepeatedLines calls new StackTracey, rather than constructing the current class. The same problem is present in withSourcesAsync(), and in the array methods, so that even overriding clean() is not sufficient to prevent an isClean being ignored.

@rrthomas
Copy link
Author

If I replace all instances of new StackTracey with new this.constructor the problem is fixed.

rrthomas added a commit to rrthomas/stacktracey that referenced this issue Mar 17, 2024
Construct the current class rather than explicitly constructing StackTracey,
so that overrides work.
@rrthomas
Copy link
Author

#17 fixes this bug.

@rrthomas
Copy link
Author

Note: I have published a friendly fork as @sc3d/stacktracey just so I can use a fixed version until my PR is merged or another fix is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant