avm2: added TextField.restrict stub (#9218)

* added TextField.restrict stub

Co-authored-by: Martin Mravec <marty.devil@gmail.com>
This commit is contained in:
MartySVK 2023-01-20 04:23:33 +01:00 committed by GitHub
parent f19e31d005
commit 6d5f6385a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -1276,6 +1276,24 @@ pub fn set_max_chars<'gc>(
Ok(Value::Undefined) Ok(Value::Undefined)
} }
pub fn restrict<'gc>(
_activation: &mut Activation<'_, 'gc>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
tracing::warn!("TextField.restrict - not yet implemented");
Ok(Value::Null)
}
pub fn set_restrict<'gc>(
_activation: &mut Activation<'_, 'gc>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
tracing::warn!("TextField.restrict - not yet implemented");
Ok(Value::Undefined)
}
/// Construct `TextField`'s class. /// Construct `TextField`'s class.
pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> { pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> {
let class = Class::new( let class = Class::new(
@ -1325,6 +1343,7 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
("maxScrollV", Some(max_scroll_v), None), ("maxScrollV", Some(max_scroll_v), None),
("maxChars", Some(max_chars), Some(set_max_chars)), ("maxChars", Some(max_chars), Some(set_max_chars)),
("multiline", Some(multiline), Some(set_multiline)), ("multiline", Some(multiline), Some(set_multiline)),
("restrict", Some(restrict), Some(set_restrict)),
("scrollH", Some(scroll_h), Some(set_scroll_h)), ("scrollH", Some(scroll_h), Some(set_scroll_h)),
("scrollV", Some(scroll_v), Some(set_scroll_v)), ("scrollV", Some(scroll_v), Some(set_scroll_v)),
("selectable", Some(selectable), Some(set_selectable)), ("selectable", Some(selectable), Some(set_selectable)),