Boa: Unassigned variables have default of null instead of undefined

Created on 26 Sep 2019  路  2Comments  路  Source: boa-dev/boa

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.

good first issue Hacktoberfest

Most helpful comment

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

All 2 comments

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

Go for it! Should be pretty straightforward.

Was this page helpful?
0 / 5 - 0 ratings