@@ -743,7 +743,7 @@ namespace Js
743
743
Js::CallInfo callInfo (Js::CallFlags_Value, _countof (args));
744
744
745
745
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
747
747
{
748
748
return JavascriptFunction::CallRootFunctionInScript (function, arguments);
749
749
});
@@ -1536,7 +1536,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
1536
1536
}
1537
1537
1538
1538
state->SetInternalProperty (
1539
- InternalPropertyIds::HiddenObject ,
1539
+ InternalPropertyIds::CachedUNumberFormat ,
1540
1540
fmt,
1541
1541
PropertyOperationFlags::PropertyOperation_None,
1542
1542
nullptr
@@ -1817,14 +1817,13 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
1817
1817
}
1818
1818
1819
1819
// 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 ;
1823
1822
FinalizableUCollator *coll = nullptr ;
1824
1823
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))
1826
1825
{
1827
- coll = reinterpret_cast <FinalizableUCollator *>(hiddenObject );
1826
+ coll = reinterpret_cast <FinalizableUCollator *>(cachedUCollator );
1828
1827
INTL_TRACE (" Using previously cached UCollator (0x%x)" , coll);
1829
1828
}
1830
1829
else
@@ -1898,7 +1897,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
1898
1897
1899
1898
// cache coll for later use (so that the condition that brought us here returns true for future calls)
1900
1899
state->SetInternalProperty (
1901
- InternalPropertyIds::HiddenObject ,
1900
+ InternalPropertyIds::CachedUCollator ,
1902
1901
coll,
1903
1902
PropertyOperationFlags::PropertyOperation_None,
1904
1903
nullptr
@@ -2360,8 +2359,8 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
2360
2359
DynamicObject *state = DynamicObject::UnsafeFromVar (args[2 ]);
2361
2360
bool toParts = JavascriptBoolean::UnsafeFromVar (args[3 ])->GetValue ();
2362
2361
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));
2365
2364
2366
2365
if (forNumberPrototypeToLocaleString)
2367
2366
{
@@ -2379,7 +2378,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
2379
2378
INTL_TRACE (" Calling NumberFormat.prototype.format(%f)" , num);
2380
2379
}
2381
2380
2382
- auto fmt = static_cast <FinalizableUNumberFormat *>(cachedFormatter );
2381
+ auto fmt = static_cast <FinalizableUNumberFormat *>(cachedUNumberFormat );
2383
2382
char16 *formatted = nullptr ;
2384
2383
int formattedLen = 0 ;
2385
2384
@@ -2620,14 +2619,13 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
2620
2619
}
2621
2620
2622
2621
// 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 ;
2626
2624
FinalizableUDateFormat *dtf = nullptr ;
2627
2625
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))
2629
2627
{
2630
- dtf = reinterpret_cast <FinalizableUDateFormat *>(hiddenObject );
2628
+ dtf = reinterpret_cast <FinalizableUDateFormat *>(cachedUDateFormat );
2631
2629
INTL_TRACE (" Using previously cached UDateFormat (0x%x)" , dtf);
2632
2630
}
2633
2631
else
@@ -2668,7 +2666,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
2668
2666
2669
2667
// cache dtf for later use (so that the condition that brought us here returns true for future calls)
2670
2668
state->SetInternalProperty (
2671
- InternalPropertyIds::HiddenObject ,
2669
+ InternalPropertyIds::CachedUDateFormat ,
2672
2670
dtf,
2673
2671
PropertyOperationFlags::PropertyOperation_None,
2674
2672
nullptr
@@ -2949,11 +2947,11 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
2949
2947
#ifdef INTL_ICU
2950
2948
static FinalizableUPluralRules *GetOrCreatePluralRulesCache (DynamicObject *stateObject, ScriptContext *scriptContext)
2951
2949
{
2952
- Var hiddenObject = nullptr ;
2950
+ Var cachedUPluralRules = nullptr ;
2953
2951
FinalizableUPluralRules *pr = nullptr ;
2954
- if (stateObject->GetInternalProperty (stateObject, InternalPropertyIds::HiddenObject , &hiddenObject , nullptr , scriptContext))
2952
+ if (stateObject->GetInternalProperty (stateObject, InternalPropertyIds::CachedUPluralRules , &cachedUPluralRules , nullptr , scriptContext))
2955
2953
{
2956
- pr = reinterpret_cast <FinalizableUPluralRules *>(hiddenObject );
2954
+ pr = reinterpret_cast <FinalizableUPluralRules *>(cachedUPluralRules );
2957
2955
INTL_TRACE (" Using previously cached UPluralRules (0x%x)" , pr);
2958
2956
}
2959
2957
else
@@ -2981,7 +2979,7 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
2981
2979
2982
2980
INTL_TRACE (" Caching UPluralRules object (0x%x) with langtag %s and type %s" , langtag->GetSz (), type->GetSz ());
2983
2981
2984
- stateObject->SetInternalProperty (InternalPropertyIds::HiddenObject , pr, PropertyOperationFlags::PropertyOperation_None, nullptr );
2982
+ stateObject->SetInternalProperty (InternalPropertyIds::CachedUPluralRules , pr, PropertyOperationFlags::PropertyOperation_None, nullptr );
2985
2983
}
2986
2984
2987
2985
return pr;
0 commit comments