mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Propagate Undefined in object expressions (#171)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
976c04be8a
commit
863601c2d5
@@ -1905,7 +1905,13 @@ impl Interpreter {
|
||||
// ( scalar | ref | var ) ":" term, the OPA
|
||||
// implementation is more like expr ":" expr
|
||||
let key = self.eval_expr(key)?;
|
||||
if key == Value::Undefined {
|
||||
return Ok(Value::Undefined);
|
||||
}
|
||||
let value = self.eval_expr(value)?;
|
||||
if value == Value::Undefined {
|
||||
return Ok(Value::Undefined);
|
||||
}
|
||||
object.insert(key, value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user