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
{{ message }}
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.
interfaceFoo{fooProp: string;toString(): string;}constfooFactory=compose<Foo,any>({fooProp: 'A Foo',toString: function(this: Foo){return`[this.fooProp]`;}});constfoo=fooFactory();assert.strictEqual(foo.toString(),'[A Foo]');
Expected behavior:
The foo.toString() in example code above is expected to return [A Foo], which has been the the case until recently #65 is merged. L107 seems to intentionally skip toString that is defined in the prototype and a toString defined by the library in L58 is used in the factory.
Actual behavior: foo.toString() returns [object Compose]
Currently a few places in the stores are relying on a custom toString to work properly. I can understand the intention of #65/#63, however I wonder if it makes sense to have the toString (if defined in the prototype) override the default one defined by the library?
The text was updated successfully, but these errors were encountered:
Good catch. Yes, with the addition of the diagnostic information, we started skipping that property, because it shouldn't be mixed, but of course if it is part of the provided prototype, it should be. I agree, we should allow it to be mixed in, if it is explicitly passed. I think we will have to modify the mixin process to allow the calling APIs to specify if the method should be overwritten or not.
Package Version:
"2.0.0-beta.13"
Code
Expected behavior:
The
foo.toString()
in example code above is expected to return[A Foo]
, which has been the the case until recently #65 is merged. L107 seems to intentionally skiptoString
that is defined in the prototype and atoString
defined by the library in L58 is used in the factory.Actual behavior:
foo.toString()
returns[object Compose]
Currently a few places in the stores are relying on a custom
toString
to work properly. I can understand the intention of #65/#63, however I wonder if it makes sense to have thetoString
(if defined in the prototype) override the default one defined by the library?The text was updated successfully, but these errors were encountered: