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

Custom data factories are incorrectly handled #466

Closed
rubensworks opened this issue Oct 30, 2024 · 2 comments · Fixed by #467
Closed

Custom data factories are incorrectly handled #466

rubensworks opened this issue Oct 30, 2024 · 2 comments · Fixed by #467

Comments

@rubensworks
Copy link
Member

When injecting a custom factory into the StreamParser (possibly other places as well), the factory methods are being used as standalone functions instead of methods on the factory object.
This makes it so that custom factories (such as rdf-data-factory) that rely on an internal this state will start failing, which causes issues such as rubensworks/rdf-dereference.js#55.

I suspect the solution may be as simple as just bind-ing the extracted factory functions to factory here.

@RubenVerborgh
Copy link
Member

Interesting; I always assumed that they were a series of functions just held together by an arbitrary object, but the spec does not say that: https://rdf.js.org/data-model-spec/#datafactory-interface
Hence, they must indeed be called as instance methods.

(It does say default values of the instance properties, but that is an error IMHO; I think they mean default arguments for the member functions.)

Copy link

🎉 This issue has been resolved in version 1.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants