diff --git a/core/src/avm2/globals/Error.as b/core/src/avm2/globals/Error.as index 0df82a7e0..834919dc5 100644 --- a/core/src/avm2/globals/Error.as +++ b/core/src/avm2/globals/Error.as @@ -1,5 +1,6 @@ package { [Ruffle(InstanceAllocator)] + [Ruffle(CallHandler)] public dynamic class Error { Error.prototype.name = "Error" diff --git a/core/src/avm2/globals/error.rs b/core/src/avm2/globals/error.rs index 158601214..2e0b4069e 100644 --- a/core/src/avm2/globals/error.rs +++ b/core/src/avm2/globals/error.rs @@ -6,6 +6,19 @@ use crate::avm2::value::Value; use crate::avm2::Error; use crate::avm2::TObject; +pub fn call_handler<'gc>( + activation: &mut Activation<'_, 'gc>, + _this: Object<'gc>, + args: &[Value<'gc>], +) -> Result, Error<'gc>> { + Ok(activation + .avm2() + .classes() + .error + .construct(activation, args)? + .into()) +} + pub fn get_stack_trace<'gc>( activation: &mut Activation<'_, 'gc>, this: Object<'gc>, diff --git a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError/test.toml b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError/test.toml index 29f3cef79..cf6123969 100644 --- a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError/test.toml +++ b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithDefErrorCaughtWithError/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock/test.toml b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock/test.toml index 29f3cef79..cf6123969 100644 --- a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock/test.toml +++ b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithNoTypeErrorCatchBlock/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1/test.toml b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1/test.toml index 29f3cef79..cf6123969 100644 --- a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1/test.toml +++ b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/MultipleCatchBlocksWithRange1/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch/test.toml b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch/test.toml index 29f3cef79..cf6123969 100644 --- a/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch/test.toml +++ b/tests/tests/swfs/avm2/from_avmplus/as3/Statements/Exceptions/NestedTryWithMulitpleCatchInsideEighthCatch/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true