diff options
Diffstat (limited to 'js/src/jsapi.h')
-rw-r--r-- | js/src/jsapi.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 1eecdbf749..63119cb288 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -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_; }; |