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

Unassigned variables have default of null instead of undefined #113

Closed
abbondanza opened this issue Sep 26, 2019 · 2 comments · Fixed by #125
Closed

Unassigned variables have default of null instead of undefined #113

abbondanza opened this issue Sep 26, 2019 · 2 comments · Fixed by #125
Assignees
Labels
good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com

Comments

@abbondanza
Copy link

abbondanza commented Sep 26, 2019

The following statements both print null instead of undefined.

var x;
x;

and

let x;
x;

Testing locally, it seems like it's enough to change the defaults at https://github.com/jasonwilliams/boa/blob/8851eba27d1df86e139e101f2b0ce26dbf3a1920/src/lib/exec.rs#L395 and https://github.com/jasonwilliams/boa/blob/8851eba27d1df86e139e101f2b0ce26dbf3a1920/src/lib/exec.rs#L407

to ValueData::Undefined.

@jasonwilliams jasonwilliams added good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com labels Sep 26, 2019
@pop
Copy link
Contributor

pop commented Sep 26, 2019

This sounds cool and I'm interested in contributing to Boa for Hacktoberfest. Mind if I start working on this?

@abbondanza
Copy link
Author

Go for it! Should be pretty straightforward.

pop added a commit to pop/boa that referenced this issue Oct 1, 2019
pop added a commit to pop/boa that referenced this issue Oct 3, 2019
jasonwilliams pushed a commit that referenced this issue Oct 3, 2019
* Unassigned variables are set to `undefined` not `null`

Fixes #113

* Rust tests for `var x` and `let x` default to undefined

* CHANGELOG for issue #113 fix + add tests/js/test.js to gitignore.
DomParfitt pushed a commit to DomParfitt/boa that referenced this issue Oct 6, 2019
* Unassigned variables are set to `undefined` not `null`

Fixes boa-dev#113

* Rust tests for `var x` and `let x` default to undefined

* CHANGELOG for issue boa-dev#113 fix + add tests/js/test.js to gitignore.
jasonwilliams pushed a commit that referenced this issue Oct 11, 2019
* Added create_constructor method

* Updated global to use json::create_constructor method

* unassigned var is undefined (#125)

* Unassigned variables are set to `undefined` not `null`

Fixes #113

* Rust tests for `var x` and `let x` default to undefined

* CHANGELOG for issue #113 fix + add tests/js/test.js to gitignore.

* fixing PR benchmarks (#132)

* fixing PR benchmarks

* Push after rebase

* Updated import order

* Formatting
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

Successfully merging a pull request may close this issue.

3 participants