mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 1216150 - Turn on the experimental Intl.DateTimeFormat.prototype.formatToParts in b2g certified apps. r=fabrice
This commit is contained in:
parent
5af86098d3
commit
1fbf47cd58
@ -437,8 +437,11 @@ DedicatedWorkerGlobalScope::WrapGlobalObject(JSContext* aCx,
|
||||
behaviors.setDiscardSource(discardSource)
|
||||
.extraWarningsOverride().set(extraWarnings);
|
||||
|
||||
const bool inCertifiedApp = mWorkerPrivate->IsInCertifiedApp();
|
||||
|
||||
JS::CompartmentCreationOptions& creationOptions = options.creationOptions();
|
||||
creationOptions.setSharedMemoryAndAtomicsEnabled(xpc::SharedMemoryEnabled());
|
||||
.setExperimentalDateTimeFormatFormatToPartsEnabled(inCertifiedApp);
|
||||
|
||||
return DedicatedWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this,
|
||||
options,
|
||||
|
@ -400,13 +400,18 @@ InitGlobalObjectOptions(JS::CompartmentOptions& aOptions,
|
||||
if (shouldDiscardSystemSource || extraWarningsForSystemJS)
|
||||
isSystem = nsContentUtils::IsSystemPrincipal(aPrincipal);
|
||||
|
||||
short status = aPrincipal->GetAppStatus();
|
||||
|
||||
// Enable the ECMA-402 experimental formatToParts in certified apps.
|
||||
if (status == nsIPrincipal::APP_STATUS_CERTIFIED) {
|
||||
aOptions.creationOptions()
|
||||
.setExperimentalDateTimeFormatFormatToPartsEnabled(true);
|
||||
}
|
||||
|
||||
if (shouldDiscardSystemSource) {
|
||||
bool discardSource = isSystem;
|
||||
if (!discardSource) {
|
||||
short status = aPrincipal->GetAppStatus();
|
||||
discardSource = status == nsIPrincipal::APP_STATUS_PRIVILEGED ||
|
||||
status == nsIPrincipal::APP_STATUS_CERTIFIED;
|
||||
}
|
||||
bool discardSource = isSystem ||
|
||||
(status == nsIPrincipal::APP_STATUS_PRIVILEGED ||
|
||||
status == nsIPrincipal::APP_STATUS_CERTIFIED);
|
||||
|
||||
aOptions.behaviors().setDiscardSource(discardSource);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user