globalizejs/globalize

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

Open

#361 建立於 2014年12月8日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (645 fork)batch import
help wantedquick change

倉庫指標

Star
 (4,759 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南