Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhorton committed May 3, 2018
1 parent 033b629 commit 54fc55f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/Runtime/Library/InJavascript/Intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,7 @@
return platform.pluralRulesSelect(pluralRules, n);
};

// params are explicitly `= undefined` to make PluralRules.length === 0
const PluralRules = function (locales = undefined, options = undefined) {
if (new.target === undefined) {
platform.raiseNeedObjectOfType("Intl.PluralRules", "PluralRules");
Expand Down
14 changes: 7 additions & 7 deletions lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ namespace Js
DEFINE_ISXLOCALEAVAILABLE(Collator, ucol)
DEFINE_ISXLOCALEAVAILABLE(NF, unum)
DEFINE_ISXLOCALEAVAILABLE(DTF, udat)
// uplur doesn't have its own getAvailable/countAvailable
// uplrules namespace doesn't have its own getAvailable/countAvailable
// assume it supports whatever is supported in the base data
DEFINE_ISXLOCALEAVAILABLE(PR, uloc)

Expand Down Expand Up @@ -2704,10 +2704,10 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)

JavascriptArray *ret = scriptContext->GetLibrary()->CreateArray(0);

// uplrules_getKeywords is only stable since ICU 61.
// For ICU < 61, we can fake it by creating an array of ["other"], which
// uplrules_getKeywords is guaranteed to return at minimum.
// This array is only used in resolved options, so the majority of the functionality can remain (namely, select() still works)
// uplrules_getKeywords is only stable since ICU 61.
// For ICU < 61, we can fake it by creating an array of ["other"], which
// uplrules_getKeywords is guaranteed to return at minimum.
// This array is only used in resolved options, so the majority of the functionality can remain (namely, select() still works)
#if defined(ICU_VERSION) && ICU_VERSION >= 61
DynamicObject *state = DynamicObject::UnsafeFromVar(args[1]);
FinalizableUPluralRules *pr = GetOrCreatePluralRulesCache(state, scriptContext);
Expand All @@ -2726,7 +2726,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)

return ret;
#else
AssertOrFailFastMsg(false, "Intl-WinGlob should not be using PluralRuleKeywords");
AssertOrFailFastMsg(false, "Intl-WinGlob should not be using PluralRulesKeywords");
return nullptr;
#endif
}
Expand Down Expand Up @@ -2761,7 +2761,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)

return JavascriptString::NewWithBuffer(selected, static_cast<charcount_t>(selectedLength), scriptContext);
#else
AssertOrFailFastMsg(false, "Intl-WinGlob should not be using PluralRuleKeywords");
AssertOrFailFastMsg(false, "Intl-WinGlob should not be using PluralRulesSelect");
return nullptr;
#endif
}
Expand Down

0 comments on commit 54fc55f

Please sign in to comment.