Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 46a2051

Browse files
author
Mike Lewis
committed
Update the usage of createRegExpRestore
createRegExpRestore now returns a restore function rather than an object that must be operated on. This commit updates the usage of this function to line up with the new implementation
1 parent aa62d07 commit 46a2051

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/11.numberformat.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, opti
7676
let internal = getInternalProperties(numberFormat);
7777

7878
// Create an object whose props can be used to restore the values of RegExp props
79-
let regexpState = createRegExpRestore();
79+
let regexpRestore = createRegExpRestore();
8080

8181
// 1. If numberFormat has an [[initializedIntlObject]] internal property with
8282
// value true, throw a TypeError exception.
@@ -300,7 +300,7 @@ export function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, opti
300300
numberFormat.format = GetFormatNumber.call(numberFormat);
301301

302302
// Restore the RegExp properties
303-
regexpState.exp.test(regexpState.input);
303+
regexpRestore();
304304

305305
// Return the newly initialised object
306306
return numberFormat;
@@ -339,7 +339,7 @@ defineProperty(Intl.NumberFormat, 'supportedLocalesOf', {
339339
throw new TypeError('supportedLocalesOf() is not a constructor');
340340

341341
// Create an object whose props can be used to restore the values of RegExp props
342-
let regexpState = createRegExpRestore(),
342+
let regexpRestore = createRegExpRestore(),
343343

344344
// 1. If options is not provided, then let options be undefined.
345345
options = arguments[1],
@@ -355,7 +355,7 @@ defineProperty(Intl.NumberFormat, 'supportedLocalesOf', {
355355
requestedLocales = CanonicalizeLocaleList(locales);
356356

357357
// Restore the RegExp properties
358-
regexpState.exp.test(regexpState.input);
358+
regexpRestore();
359359

360360
// 4. Return the result of calling the SupportedLocales abstract operation
361361
// (defined in 9.2.8) with arguments availableLocales, requestedLocales,

src/12.datetimeformat.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales,
106106
let internal = getInternalProperties(dateTimeFormat);
107107

108108
// Create an object whose props can be used to restore the values of RegExp props
109-
let regexpState = createRegExpRestore();
109+
let regexpRestore = createRegExpRestore();
110110

111111
// 1. If dateTimeFormat has an [[initializedIntlObject]] internal property with
112112
// value true, throw a TypeError exception.
@@ -337,7 +337,7 @@ export function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales,
337337
dateTimeFormat.format = GetFormatDateTime.call(dateTimeFormat);
338338

339339
// Restore the RegExp properties
340-
regexpState.exp.test(regexpState.input);
340+
regexpRestore();
341341

342342
// Return the newly initialised object
343343
return dateTimeFormat;
@@ -763,7 +763,7 @@ defineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', {
763763
throw new TypeError('supportedLocalesOf() is not a constructor');
764764

765765
// Create an object whose props can be used to restore the values of RegExp props
766-
let regexpState = createRegExpRestore(),
766+
let regexpRestore = createRegExpRestore(),
767767

768768
// 1. If options is not provided, then let options be undefined.
769769
options = arguments[1],
@@ -779,7 +779,7 @@ defineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', {
779779
requestedLocales = CanonicalizeLocaleList(locales);
780780

781781
// Restore the RegExp properties
782-
regexpState.exp.test(regexpState.input);
782+
regexpRestore();
783783

784784
// 4. Return the result of calling the SupportedLocales abstract operation
785785
// (defined in 9.2.8) with arguments availableLocales, requestedLocales,
@@ -865,7 +865,7 @@ function CreateDateTimeParts(dateTimeFormat, x) {
865865
let internal = dateTimeFormat.__getInternalProperties(secret);
866866

867867
// Creating restore point for properties on the RegExp object... please wait
868-
/* let regexpState = */createRegExpRestore(); // ###TODO: review this
868+
/* let regexpRestore = */createRegExpRestore(); // ###TODO: review this
869869

870870
// 2. Let locale be the value of the [[locale]] internal property of dateTimeFormat.
871871
let locale = internal['[[locale]]'];

0 commit comments

Comments
 (0)