Skip to content

Commit

Permalink
Update the usage of createRegExpRestore
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mike Lewis committed Jul 7, 2016
1 parent aa62d07 commit 46a2051
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/11.numberformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, opti
let internal = getInternalProperties(numberFormat);

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

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

// Restore the RegExp properties
regexpState.exp.test(regexpState.input);
regexpRestore();

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

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

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

// Restore the RegExp properties
regexpState.exp.test(regexpState.input);
regexpRestore();

// 4. Return the result of calling the SupportedLocales abstract operation
// (defined in 9.2.8) with arguments availableLocales, requestedLocales,
Expand Down
10 changes: 5 additions & 5 deletions src/12.datetimeformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales,
let internal = getInternalProperties(dateTimeFormat);

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

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

// Restore the RegExp properties
regexpState.exp.test(regexpState.input);
regexpRestore();

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

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

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

// Restore the RegExp properties
regexpState.exp.test(regexpState.input);
regexpRestore();

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

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

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

0 comments on commit 46a2051

Please sign in to comment.