Closed
Description
In ResolveLocale
, we have
- a. Let privateIndex be Call(%StringProto_indexOf%, foundLocale, « "-x-" »).
subsequently, we have
- b. If privateIndex = -1, then
i. Let foundLocale be the concatenation of foundLocale and supportedExtension.
and
- c. Else,
i. Let preExtension be the substring of foundLocale from position 0, inclusive, to position privateIndex, exclusive.
ii. Let postExtension be the substring of foundLocale from position privateIndex to the end of the string.
iii. Let foundLocale be the concatenation of preExtension, supportedExtension, and postExtension.
For calculating the index, we call out to the %StringProto_indexOf%
intrinsic, but for substring calculation we don't call out to String.prototype.substring
.
It'd be great to make this consistent both here and elsewhere in the spec.
I'd prefer for us to remove calls out to these builtins (like %StringProto_indexOf%
) and just inline the appropriate steps as it's currently done for substring calculation.