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

Commit e93b114

Browse files
spencercarnagecaridy
authored andcommitted
Safely call defineProperty when setting array length. (#273)
* wrap setting array length in try catch Older browsers, such as Firefox 22 and below, throw `new InternalError("defining the length property on an array is not currently supported")` when trying to set the length with `defineProperty` so a try catch will allow for those that do support it to use it, while those that don't fail due to the error. * removed defineProperty for array length and fixed lint error
1 parent a0c3b3e commit e93b114

7 files changed

+1155
-95
lines changed

dist/Intl.complete.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Intl.js

+1,148-85
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Intl.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Intl.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Intl.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/14.pluralrules.js

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from './9.negotiation.js';
1313

1414
import {
15-
FormatNumberToString,
1615
SetNumberFormatDigitOptions
1716
} from './11.numberformat.js';
1817

src/9.negotiation.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,7 @@ export function /*9.2.8 */SupportedLocales (availableLocales, requestedLocales,
607607
writable: false, configurable: false, value: subset[P]
608608
});
609609
}
610-
// "Freeze" the array so no new elements can be added
611-
defineProperty(subset, 'length', { writable: false });
612-
610+
613611
// 5. Return subset
614612
return subset;
615613
}

0 commit comments

Comments
 (0)