globalizejs / globalizejs/globalize

Code cleanup: Can we remove the nested functions pattern of util.assertFns?

Open
#361 0 comments 0 reactions 0 assignees View on GitHub
help wanted quick change
Dominant language
JavaScript
Stars
4.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

Ref: https://github.com/jquery/globalize/pull/351/files#r21450932

---

``` js
util.assertCurrencyParameter( assert, "currency", function( invalidValue ) {
return function() {
Globalize.currencyFormatter( invalidValue );
};
});
```

@jzaefferer

> I guess we've discussed this before as well, still doesn't make much sense: Why does this test have to return two nested functions?

@rxaviers

> Yeap, we have discussed about this and it was clear this was needed. Although, I also believe this could be simplified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.