Browse Source

Async/await run returns undefined rather than panic

pull/836/head
Paul Lancaster 4 years ago
parent
commit
758a765ca2
  1. 5
      boa/src/syntax/ast/node/await_expr/mod.rs
  2. 4
      boa/src/syntax/ast/node/declaration/async_function_decl/mod.rs
  3. 5
      boa/src/syntax/ast/node/declaration/async_function_expr/mod.rs

5
boa/src/syntax/ast/node/await_expr/mod.rs

@ -23,9 +23,10 @@ pub struct AwaitExpr {
} }
impl Executable for AwaitExpr { impl Executable for AwaitExpr {
fn run(&self, interpreter: &mut Context) -> Result<Value> { fn run(&self, _: &mut Context) -> Result<Value> {
let _timer = BoaProfiler::global().start_event("AwaitExpression", "exec"); let _timer = BoaProfiler::global().start_event("AwaitExpression", "exec");
unimplemented!("Await expression execution"); // unimplemented!("Await expression execution");
return Ok(Value::Undefined);
} }
} }

4
boa/src/syntax/ast/node/declaration/async_function_decl/mod.rs

@ -79,9 +79,9 @@ impl AsyncFunctionDecl {
} }
impl Executable for AsyncFunctionDecl { impl Executable for AsyncFunctionDecl {
fn run(&self, interpreter: &mut Context) -> Result<Value> { fn run(&self, _: &mut Context) -> Result<Value> {
let _timer = BoaProfiler::global().start_event("AsyncFunctionDecl", "exec"); let _timer = BoaProfiler::global().start_event("AsyncFunctionDecl", "exec");
unimplemented!("Execute AsyncFunctionDecl"); // unimplemented!("Execute AsyncFunctionDecl");
Ok(Value::undefined()) Ok(Value::undefined())
} }
} }

5
boa/src/syntax/ast/node/declaration/async_function_expr/mod.rs

@ -76,8 +76,9 @@ impl AsyncFunctionExpr {
} }
impl Executable for AsyncFunctionExpr { impl Executable for AsyncFunctionExpr {
fn run(&self, interpreter: &mut Context) -> Result<Value> { fn run(&self, _: &mut Context) -> Result<Value> {
unimplemented!("Execute AsyncFunctionExpr"); // unimplemented!("Execute AsyncFunctionExpr");
return Ok(Value::Undefined);
} }
} }

Loading…
Cancel
Save