You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redefining a function in repl panics with binding already exists error
To Reproduce
Steps to reproduce the issue, or JavaScript code that causes this failure.
cargo run function x() {} enter function x() { return 3; } enter panics
Expected behavior
It should override the previous binding
Backtrace
thread 'main' panicked at 'Binding already exists!', boa/src/environment/global_environment_record.rs:108:13
stack backtrace:0:backtrace::backtrace::libunwind::trace
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:861:backtrace::backtrace::trace_unsynchronized
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:662:std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:783: <std::sys_common::backtrace::_print::DisplayBacktraceas core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:594:core::fmt::write
at src/libcore/fmt/mod.rs:10765:std::io::Write::write_fmt
at src/libstd/io/mod.rs:15376:std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:627:std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:498:std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:1989:std::panicking::default_hook
at src/libstd/panicking.rs:21710:std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:52611:std::panicking::begin_panic
12: <boa::environment::global_environment_record::GlobalEnvironmentRecordas boa::environment::environment_record_trait::EnvironmentRecordTrait>::create_mutable_binding
at boa/src/environment/global_environment_record.rs:10813:boa::environment::lexical_environment::LexicalEnvironment::create_mutable_binding
at /Users/dvtkrlbs/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.8.2/src/raw/mod.rs:182214:boa::exec::declaration::<impl boa::exec::Executablefor boa::syntax::ast::node::declaration::FunctionDecl>::run
at boa/src/exec/declaration/mod.rs:2415: <boa::syntax::ast::node::Nodeas boa::exec::Executable>::run
at boa/src/exec/mod.rs:38916:boa::exec::statement_list::<impl boa::exec::Executablefor boa::syntax::ast::node::statement_list::StatementList>::run
at boa/src/exec/statement_list.rs:1517:boa::forward_val
at boa/src/lib.rs:8918:boa::main
at boa_cli/src/main.rs:19019:std::rt::lang_start::{{closure}}
at /Users/dvtkrlbs/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:6720:std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:5221:std::panicking::try::do_call
at src/libstd/panicking.rs:34822:std::panicking::try
at src/libstd/panicking.rs:32523:std::panic::catch_unwind
at src/libstd/panic.rs:39424:std::rt::lang_start_internal
at src/libstd/rt.rs:5125:std::rt::lang_start
at /Users/dvtkrlbs/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/rt.rs:6726: main
note:Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The text was updated successfully, but these errors were encountered:
Redefining a function in repl panics with binding already exists error
To Reproduce
Steps to reproduce the issue, or JavaScript code that causes this failure.
cargo run
function x() {}
enterfunction x() { return 3; }
enter panicsExpected behavior
It should override the previous binding
Backtrace
The text was updated successfully, but these errors were encountered: