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

Bad prototypes for String, Number and Boolean #980

Closed
tofpie opened this issue Dec 18, 2020 · 0 comments · Fixed by #981
Closed

Bad prototypes for String, Number and Boolean #980

tofpie opened this issue Dec 18, 2020 · 0 comments · Fixed by #981
Assignees
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics
Milestone

Comments

@tofpie
Copy link
Contributor

tofpie commented Dec 18, 2020

Describe the bug
The prototypes for String, Number and Boolean should be respectively String(""), Number(0) and Boolean(false).

To Reproduce
This JavaScript code reproduces the issue:

>> String.prototype.toString()
Uncaught: "TypeError": "'this' is not a string"
>> Number.prototype.toString()
Uncaught: "TypeError": "'this' is not a number"
>> Boolean.prototype.toString()
Uncaught: "TypeError": "'this' is not a boolean"

Expected behavior

>> String.prototype.toString()
""
>> Number.prototype.toString()
"0"
>> Boolean.prototype.toString()
"false"

Build environment

  • OS: Windows 10
  • Version: 0.10
  • Target triple: x86_64-pc-windows-msvc
  • Rustc version: rustc 1.48.0 (7eac88abb 2020-11-16)

Additional context
String prototype specification
Number prototype specification
Boolean prototype specification

@tofpie tofpie added the bug Something isn't working label Dec 18, 2020
@Razican Razican added the builtins PRs and Issues related to builtins/intrinsics label Dec 18, 2020
@Razican Razican added this to the v0.11.0 milestone Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants