Open rubensworks opened 6 days ago
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 asrdf-data-factory
) that rely on an internalthis
state will start failing, which causes issues such as https://github.com/rubensworks/rdf-dereference.js/issues/55.I suspect the solution may be as simple as just
bind
-ing the extracted factory functions tofactory
here.