Skip to content

Commit

Permalink
make String.prototype.trimEnd actually trim end not start
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Dec 23, 2024
1 parent 233f2dc commit 2a2c102
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub fn trim_start(cx: CallContext) -> Result<Value, Value> {

pub fn trim_end(cx: CallContext) -> Result<Value, Value> {
let string = cx.this.to_js_string(cx.scope)?;
let result = string.res(cx.scope).trim_start().to_owned();
let result = string.res(cx.scope).trim_end().to_owned();
Ok(Value::string(cx.scope.intern(result.as_ref()).into()))
}

Expand Down

0 comments on commit 2a2c102

Please sign in to comment.