globalizejs/globalize

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

Open

#361 ouverte le 8 déc. 2014

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)JavaScript (645 forks)batch import
help wantedquick change

Métriques du dépôt

Stars
 (4 759 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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


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.

Guide contributeur