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

Add [[Call]] to String #100

Closed
jasonwilliams opened this issue Sep 8, 2019 · 0 comments
Closed

Add [[Call]] to String #100

jasonwilliams opened this issue Sep 8, 2019 · 0 comments
Labels
good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com

Comments

@jasonwilliams
Copy link
Member

jasonwilliams commented Sep 8, 2019

This should be an easy one..
String has a [[Construct]] method which returns a string instance. This is working fine.
The [[Call]] version should return a native string.
https://github.com/jasonwilliams/boa/blob/master/src/lib/js/string.rs#L529-L532

For inspiration, see how Boolean works:
https://github.com/jasonwilliams/boa/blob/master/src/lib/js/boolean.rs#L53-L54

It might be hard to test for now, as the executor currently doesn't use [[Call]]

Spec

https://tc39.es/ecma262/#sec-string-constructor-string-value

@jasonwilliams jasonwilliams added good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com labels Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com
Projects
None yet
Development

No branches or pull requests

1 participant