You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 factoryhere.
The text was updated successfully, but these errors were encountered:
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.)
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 internalthis
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 tofactory
here.The text was updated successfully, but these errors were encountered: