Skip to content

Commit

Permalink
concatenate bound function args with local args
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Dec 28, 2024
1 parent b8e5744 commit be617d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/dash_vm/src/value/function/bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::frame::This;
use crate::gc::ObjectId;
use crate::value::object::{NamedObject, Object};
use crate::value::{Typeof, Unrooted, Value};
use crate::{delegate, extract, Vm};
use crate::{Vm, delegate, extract};

#[derive(Debug, Trace)]
pub struct BoundFunction {
Expand Down Expand Up @@ -47,8 +47,8 @@ impl Object for BoundFunction {
) -> Result<Unrooted, Unrooted> {
let target_this = self.this.map_or(this, This::Bound);

// TODO: args should be concatenated with self.args
let target_args = self.args.clone().unwrap_or(args);
let mut target_args = self.args.clone().unwrap_or_default();
target_args.extend(args);

self.callee.apply(scope, target_this, target_args)
}
Expand Down

0 comments on commit be617d6

Please sign in to comment.