@@ -743,7 +743,7 @@ namespace Js
743743 Js::CallInfo callInfo (Js::CallFlags_Value, _countof (args));
744744
745745 Js::Arguments arguments (callInfo, args);
746- scriptContext->GetThreadContext ()->ExecuteImplicitCall (function, Js::ImplicitCall_Accessor, [=]()->Js ::Var
746+ scriptContext->GetThreadContext ()->ExecuteImplicitCall (function, Js::ImplicitCall_Accessor, [=]()->Js ::Var
747747 {
748748 return JavascriptFunction::CallRootFunctionInScript (function, arguments);
749749 });
@@ -1536,7 +1536,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
15361536 }
15371537
15381538 state->SetInternalProperty (
1539- InternalPropertyIds::HiddenObject ,
1539+ InternalPropertyIds::CachedUNumberFormat ,
15401540 fmt,
15411541 PropertyOperationFlags::PropertyOperation_None,
15421542 nullptr
@@ -1817,14 +1817,13 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
18171817 }
18181818
18191819 // Below, we lazy-initialize the backing UCollator on the first call to localeCompare
1820- // On subsequent calls, the UCollator will be cached in state.hiddenObject
1821- // TODO(jahorto): Make these property IDs sane, so that hiddenObject doesn't have different meanings in different contexts
1822- Var hiddenObject = nullptr ;
1820+ // On subsequent calls, the UCollator will be cached in state.CachedUCollator
1821+ Var cachedUCollator = nullptr ;
18231822 FinalizableUCollator *coll = nullptr ;
18241823 UErrorCode status = U_ZERO_ERROR;
1825- if (state->GetInternalProperty (state, Js:: InternalPropertyIds::HiddenObject , &hiddenObject , nullptr , scriptContext))
1824+ if (state->GetInternalProperty (state, InternalPropertyIds::CachedUCollator , &cachedUCollator , nullptr , scriptContext))
18261825 {
1827- coll = reinterpret_cast <FinalizableUCollator *>(hiddenObject );
1826+ coll = reinterpret_cast <FinalizableUCollator *>(cachedUCollator );
18281827 INTL_TRACE (" Using previously cached UCollator (0x%x)" , coll);
18291828 }
18301829 else
@@ -1898,7 +1897,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
18981897
18991898 // cache coll for later use (so that the condition that brought us here returns true for future calls)
19001899 state->SetInternalProperty (
1901- InternalPropertyIds::HiddenObject ,
1900+ InternalPropertyIds::CachedUCollator ,
19021901 coll,
19031902 PropertyOperationFlags::PropertyOperation_None,
19041903 nullptr
@@ -2360,8 +2359,8 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
23602359 DynamicObject *state = DynamicObject::UnsafeFromVar (args[2 ]);
23612360 bool toParts = JavascriptBoolean::UnsafeFromVar (args[3 ])->GetValue ();
23622361 bool forNumberPrototypeToLocaleString = JavascriptBoolean::UnsafeFromVar (args[4 ])->GetValue ();
2363- Var cachedFormatter = nullptr ; // cached by EntryIntl_CacheNumberFormat
2364- AssertOrFailFast (state->GetInternalProperty (state, Js:: InternalPropertyIds::HiddenObject , &cachedFormatter , NULL , scriptContext));
2362+ Var cachedUNumberFormat = nullptr ; // cached by EntryIntl_CacheNumberFormat
2363+ AssertOrFailFast (state->GetInternalProperty (state, InternalPropertyIds::CachedUNumberFormat , &cachedUNumberFormat , NULL , scriptContext));
23652364
23662365 if (forNumberPrototypeToLocaleString)
23672366 {
@@ -2379,7 +2378,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
23792378 INTL_TRACE (" Calling NumberFormat.prototype.format(%f)" , num);
23802379 }
23812380
2382- auto fmt = static_cast <FinalizableUNumberFormat *>(cachedFormatter );
2381+ auto fmt = static_cast <FinalizableUNumberFormat *>(cachedUNumberFormat );
23832382 char16 *formatted = nullptr ;
23842383 int formattedLen = 0 ;
23852384
@@ -2620,14 +2619,13 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
26202619 }
26212620
26222621 // Below, we lazy-initialize the backing UDateFormat on the first call to format{ToParts}
2623- // On subsequent calls, the UDateFormat will be cached in state.hiddenObject
2624- // TODO(jahorto): Make these property IDs sane, so that hiddenObject doesn't have different meanings in different contexts
2625- Var hiddenObject = nullptr ;
2622+ // On subsequent calls, the UDateFormat will be cached in state.CachedUDateFormat
2623+ Var cachedUDateFormat = nullptr ;
26262624 FinalizableUDateFormat *dtf = nullptr ;
26272625 UErrorCode status = U_ZERO_ERROR;
2628- if (state->GetInternalProperty (state, Js:: InternalPropertyIds::HiddenObject , &hiddenObject , nullptr , scriptContext))
2626+ if (state->GetInternalProperty (state, InternalPropertyIds::CachedUDateFormat , &cachedUDateFormat , nullptr , scriptContext))
26292627 {
2630- dtf = reinterpret_cast <FinalizableUDateFormat *>(hiddenObject );
2628+ dtf = reinterpret_cast <FinalizableUDateFormat *>(cachedUDateFormat );
26312629 INTL_TRACE (" Using previously cached UDateFormat (0x%x)" , dtf);
26322630 }
26332631 else
@@ -2668,7 +2666,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
26682666
26692667 // cache dtf for later use (so that the condition that brought us here returns true for future calls)
26702668 state->SetInternalProperty (
2671- InternalPropertyIds::HiddenObject ,
2669+ InternalPropertyIds::CachedUDateFormat ,
26722670 dtf,
26732671 PropertyOperationFlags::PropertyOperation_None,
26742672 nullptr
@@ -2949,11 +2947,11 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
29492947#ifdef INTL_ICU
29502948 static FinalizableUPluralRules *GetOrCreatePluralRulesCache (DynamicObject *stateObject, ScriptContext *scriptContext)
29512949 {
2952- Var hiddenObject = nullptr ;
2950+ Var cachedUPluralRules = nullptr ;
29532951 FinalizableUPluralRules *pr = nullptr ;
2954- if (stateObject->GetInternalProperty (stateObject, InternalPropertyIds::HiddenObject , &hiddenObject , nullptr , scriptContext))
2952+ if (stateObject->GetInternalProperty (stateObject, InternalPropertyIds::CachedUPluralRules , &cachedUPluralRules , nullptr , scriptContext))
29552953 {
2956- pr = reinterpret_cast <FinalizableUPluralRules *>(hiddenObject );
2954+ pr = reinterpret_cast <FinalizableUPluralRules *>(cachedUPluralRules );
29572955 INTL_TRACE (" Using previously cached UPluralRules (0x%x)" , pr);
29582956 }
29592957 else
@@ -2981,7 +2979,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
29812979
29822980 INTL_TRACE (" Caching UPluralRules object (0x%x) with langtag %s and type %s" , langtag->GetSz (), type->GetSz ());
29832981
2984- stateObject->SetInternalProperty (InternalPropertyIds::HiddenObject , pr, PropertyOperationFlags::PropertyOperation_None, nullptr );
2982+ stateObject->SetInternalProperty (InternalPropertyIds::CachedUPluralRules , pr, PropertyOperationFlags::PropertyOperation_None, nullptr );
29852983 }
29862984
29872985 return pr;
0 commit comments