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

Implement Symbol.prototype[ @@toPrimitive ]( hint ) #1233

Closed
HalidOdat opened this issue May 7, 2021 · 4 comments · Fixed by #1634
Closed

Implement Symbol.prototype[ @@toPrimitive ]( hint ) #1233

HalidOdat opened this issue May 7, 2021 · 4 comments · Fixed by #1634
Assignees
Labels
builtins PRs and Issues related to builtins/intrinsics E-Easy Easy enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@HalidOdat
Copy link
Member

ECMASCript feature

Implement Symbol.prototype[ @@toPrimitive ]( hint ).

The to primitive function described in spec can be created with FunctionBuilder and it can be added to Symbol.prototype with ConstructorBuilder::property() method.

@HalidOdat HalidOdat added enhancement New feature or request good first issue Good for newcomers E-Easy Easy builtins PRs and Issues related to builtins/intrinsics labels May 7, 2021
@moadmmh
Copy link
Contributor

moadmmh commented May 28, 2021

I'll take this

@jedel1043
Copy link
Member

@moadmmh Are you still working on this? If you have any questions about the implementation, don't hesitate to ask us! 😁

@Nimpruda
Copy link
Contributor

Nimpruda commented Oct 4, 2021

All the tests for Symbol.toPrimitive and there is already a Well Known Symbol named to_primitive. Furthermore, I tried running the example from mdn and it works just like it's supposed to.

What am I supposed to fix this ? Could you tell me where I should start ?

Thanks and sorry for my english I'm not native.

@jedel1043
Copy link
Member

jedel1043 commented Oct 4, 2021

All the tests for Symbol.toPrimitive and there is already a Well Known Symbol named to_primitive. Furthermore, I tried running the example from mdn and it works just like it's supposed to.

What am I supposed to fix this ? Could you tell me where I should start ?

Thanks and sorry for my english I'm not native.

I think you're confusing Symbol.toPrimitive with Symbol.prototype[ @@toPrimitive ]

Try to run something like:

const sym = Symbol("example");
sym === sym[Symbol.toPrimitive](); // true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics E-Easy Easy enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants