Issue #1756 - Initial wrapped implementation in C++

This commit is contained in:
Moonchild 2021-03-31 11:54:20 +00:00 committed by roytam1
commit 5df0028108
10 changed files with 760 additions and 27 deletions

View file

@ -2206,6 +2206,7 @@ class JS_PUBLIC_API(CompartmentCreationOptions)
mergeable_(false),
preserveJitCode_(false),
cloneSingletons_(false),
experimentalNumberFormatFormatToPartsEnabled_(false),
sharedMemoryAndAtomics_(false),
secureContext_(false)
{
@ -2270,6 +2271,23 @@ class JS_PUBLIC_API(CompartmentCreationOptions)
return *this;
}
// ECMA-402 is considering adding a "formatToParts" NumberFormat method,
// that exposes not just a formatted string but its subcomponents. The
// method, its semantics, and its name aren't finalized, so for now it's
// exposed *only* if requested.
//
// Until "formatToParts" is included in a final specification edition, it's
// subject to change or removal at any time. Do *not* rely on it in
// mission-critical code that can't be changed if ECMA-402 decides not to
// accept the method in its current form.
bool experimentalNumberFormatFormatToPartsEnabled() const {
return experimentalNumberFormatFormatToPartsEnabled_;
}
CompartmentCreationOptions& setExperimentalNumberFormatFormatToPartsEnabled(bool flag) {
experimentalNumberFormatFormatToPartsEnabled_ = flag;
return *this;
}
bool getSharedMemoryAndAtomicsEnabled() const;
CompartmentCreationOptions& setSharedMemoryAndAtomicsEnabled(bool flag);
@ -2294,6 +2312,7 @@ class JS_PUBLIC_API(CompartmentCreationOptions)
bool mergeable_;
bool preserveJitCode_;
bool cloneSingletons_;
bool experimentalNumberFormatFormatToPartsEnabled_;
bool sharedMemoryAndAtomics_;
bool secureContext_;
};