mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Use &Val for submov key
This commit is contained in:
@@ -70,7 +70,7 @@ where
|
||||
Ok(Self::bo_sub(&key.to_string()))
|
||||
}
|
||||
|
||||
fn submov(&mut self, _key: Val, _value: Val) -> Result<(), Val> {
|
||||
fn submov(&mut self, _key: &Val, _value: Val) -> Result<(), Val> {
|
||||
Err(format!("Cannot assign to subscript of {} builtin", Self::bo_name()).to_type_error())
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static SET_MESSAGE: NativeFunction = native_fn(|mut this, params| {
|
||||
None => "".to_string(),
|
||||
};
|
||||
|
||||
op_submov(this.get_mut()?, "message".to_val(), message.to_val())?;
|
||||
op_submov(this.get_mut()?, &"message".to_val(), message.to_val())?;
|
||||
|
||||
Ok(Val::Undefined)
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ static SET_MESSAGE: NativeFunction = native_fn(|mut this, params| {
|
||||
None => "".to_string(),
|
||||
};
|
||||
|
||||
op_submov(this.get_mut()?, "message".to_val(), message.to_val())?;
|
||||
op_submov(this.get_mut()?, &"message".to_val(), message.to_val())?;
|
||||
|
||||
Ok(Val::Undefined)
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ static SET_MESSAGE: NativeFunction = native_fn(|mut this, params| {
|
||||
None => "".to_string(),
|
||||
};
|
||||
|
||||
op_submov(this.get_mut()?, "message".to_val(), message.to_val())?;
|
||||
op_submov(this.get_mut()?, &"message".to_val(), message.to_val())?;
|
||||
|
||||
Ok(Val::Undefined)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user