Closed ssut closed 6 years ago
Hi @ssut , it's there 2 problems:
.call()
method to z
passing the arguments in context, since any library could know where Types
comes without doing this explicitly, so you should refactor index to:const match = matches('a').call({ Types },
(x = Types.A) => 'matched A',
(x = Types.B) => 'matched B',
);
z@1.0.4
, please use this version while we don't fix this bug, thanks.Hey @ssut , fixed that on z@1.0.8
, please ensure you are using this newer version and passing Types
on .call
method:
const match = matches('a').call({ Types },
(x = Types.A) => 'matched A',
(x = Types.B) => 'matched B',
);
Please report if it's everything working now, thanks!
I have code like:
types.js
index.js
and the expected behavior is to just work as the
x
is assigned by constant, but it seems not so just throwing an TypeError which looks like:I believe this should be filed in the js-function-reflector but I do it here because
z
has a dependency on it, which appears to be maintained by you.