Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference implementation of the %s format specifier should call String #141

Closed
fmartin5 opened this issue May 28, 2018 · 3 comments
Closed

Comments

@fmartin5
Copy link
Contributor

In the reference implementation for format specifiers, the %s format specifier is implemented using implicit string coercion and the addition operator:

'%s': function(a) { return '' + a; }, // string

Given the corresponding spec:

If specifier is %s, let converted be the result of Call(%String%, undefined, « current »).

I think explicitly calling the String constructor, as a function, would be a more explicit and accurate way to represent the meaning of the spec.

For example:

  '%s': function(a) { return String(a); }, // string
@domfarolino
Copy link
Member

I agree, however we're probably going to rip out the reference implementation and some of the NOTES.md section IIRC, I can double check though.

@SamB
Copy link

SamB commented Dec 4, 2022

Seems like this should be closed now?

@domfarolino
Copy link
Member

Agreed, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants