Skip to content

Spec should be consistent about calling intrinsics #247

Closed
@gsathya

Description

@gsathya

In ResolveLocale, we have

  1. a. Let privateIndex be Call(%StringProto_indexOf%, foundLocale, « "-x-" »).

subsequently, we have

  1. b. If privateIndex = -1, then
    i. Let foundLocale be the concatenation of foundLocale and supportedExtension.

and

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: localeComponent: locale identifierseditorialInvolves an editorial fixs: help wantedStatus: help wanted; needs proposal champion

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions