mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 11:41:13 +08:00
perf: 收紧字符串借用语义消除跨分配点 UB
This commit is contained in:
@@ -250,7 +250,7 @@ fn to_bigint<H: VmHost>(vm: &mut H, val: JsValue) -> Result<JsValue, JsValue> {
|
||||
return Err(crate::error::create_type_error(vm, "Cannot convert a Number value to a BigInt"));
|
||||
}
|
||||
if val.is_string() {
|
||||
let s = unsafe { oxide_runtime_api::string_data(val) }.to_string();
|
||||
let s = oxide_runtime_api::to_string(val);
|
||||
return match string_to_bigint(vm, &s) {
|
||||
Ok(v) => Ok(v),
|
||||
Err(e) => Err(e),
|
||||
|
||||
Reference in New Issue
Block a user