Skip to content

Commit

Permalink
Unassigned variables are set to undefined not null
Browse files Browse the repository at this point in the history
  • Loading branch information
pop committed Oct 3, 2019
1 parent 1c3fea4 commit 022fb02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl Executor for Interpreter {
let (name, value) = var.clone();
let val = match value {
Some(v) => self.run(&v)?,
None => Gc::new(ValueData::Null),
None => Gc::new(ValueData::Undefined),
};
self.realm
.environment
Expand All @@ -403,7 +403,7 @@ impl Executor for Interpreter {
let (name, value) = var.clone();
let val = match value {
Some(v) => self.run(&v)?,
None => Gc::new(ValueData::Null),
None => Gc::new(ValueData::Undefined),
};
self.realm
.environment
Expand Down

0 comments on commit 022fb02

Please sign in to comment.