mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Ignore errors from builtin functions in non strict mode (#154)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
22047287b4
commit
10f2caf0c0
@@ -2055,7 +2055,12 @@ impl Interpreter {
|
||||
}
|
||||
}
|
||||
|
||||
let v = builtin.0(span, params, &args[..], self.strict_builtin_errors)?;
|
||||
let v = match builtin.0(span, params, &args[..], self.strict_builtin_errors) {
|
||||
Ok(v) => v,
|
||||
// Ignore errors if we are not evaluating in strict mode.
|
||||
Err(_) if !self.strict_builtin_errors => return Ok(Value::Undefined),
|
||||
Err(e) => Err(e)?,
|
||||
};
|
||||
|
||||
// Handle trace function.
|
||||
// TODO: with modifier.
|
||||
|
||||
Reference in New Issue
Block a user