Skip to content

Commit a5422a8

Browse files
committed
avm2: Add ParamtersExt::get_value
1 parent 933034a commit a5422a8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/avm2/parameters.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use crate::string::AvmString;
99
/// It is expected that the AS signature is correct and you only operate on values defined from it.
1010
/// These values will be `expect()`ed to exist, and any method here will panic if they're missing.
1111
pub trait ParametersExt<'gc> {
12+
/// Gets the value at the given index.
13+
fn get_value(&self, index: usize) -> Value<'gc>;
14+
1215
/// Gets the value at the given index and coerces it to an Object.
1316
///
1417
/// If the value is null or is undefined, a TypeError 2007 is raised.
@@ -86,6 +89,11 @@ pub trait ParametersExt<'gc> {
8689
}
8790

8891
impl<'gc> ParametersExt<'gc> for &[Value<'gc>] {
92+
#[inline]
93+
fn get_value(&self, index: usize) -> Value<'gc> {
94+
self[index]
95+
}
96+
8997
fn get_object(
9098
&self,
9199
activation: &mut Activation<'_, 'gc>,

0 commit comments

Comments
 (0)