diff --git a/core/src/avm2/globals/DefinitionError.as b/core/src/avm2/globals/DefinitionError.as new file mode 100644 index 000000000..6d7ad0507 --- /dev/null +++ b/core/src/avm2/globals/DefinitionError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/DefinitionError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package +{ + public dynamic class DefinitionError extends Error + { + prototype.name = "DefinitionError"; + + public function DefinitionError(message:String = "", id:int = 0) + { + super(message, id); + this.name = prototype.name; + } + + } +} + diff --git a/core/src/avm2/globals/EvalError.as b/core/src/avm2/globals/EvalError.as new file mode 100644 index 000000000..5cf0c08f6 --- /dev/null +++ b/core/src/avm2/globals/EvalError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/EvalError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package +{ + + public dynamic class EvalError extends Error + { + prototype.name = "EvalError"; + + public function EvalError(message:String = "", id:int = 0) + { + super(message, id); + this.name = prototype.name; + } + + } +} diff --git a/core/src/avm2/globals/SecurityError.as b/core/src/avm2/globals/SecurityError.as new file mode 100644 index 000000000..4c7614d48 --- /dev/null +++ b/core/src/avm2/globals/SecurityError.as @@ -0,0 +1,21 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/SecurityError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package +{ + + public dynamic class SecurityError extends Error + { + prototype.name = "SecurityError"; + + public function SecurityError(message:String = "", id:int = 0) + { + super(message, id); + this.name = prototype.name; + } + + } +} + diff --git a/core/src/avm2/globals/SyntaxError.as b/core/src/avm2/globals/SyntaxError.as new file mode 100644 index 000000000..18c3cca3a --- /dev/null +++ b/core/src/avm2/globals/SyntaxError.as @@ -0,0 +1,21 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/SyntaxError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package +{ + + public dynamic class SyntaxError extends Error + { + prototype.name = "SyntaxError"; + + public function SyntaxError(message:String = "", id:int = 0) + { + super(message, id); + this.name = prototype.name; + } + + } +} + diff --git a/core/src/avm2/globals/URIError.as b/core/src/avm2/globals/URIError.as new file mode 100644 index 000000000..c42912081 --- /dev/null +++ b/core/src/avm2/globals/URIError.as @@ -0,0 +1,21 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/URIError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package +{ + + public dynamic class URIError extends Error + { + prototype.name = "URIError"; + + public function URIError(message:String = "", id:int = 0) + { + super(message, id); + this.name = prototype.name; + } + + } +} + diff --git a/core/src/avm2/globals/VerifyError.as b/core/src/avm2/globals/VerifyError.as new file mode 100644 index 000000000..463a8476d --- /dev/null +++ b/core/src/avm2/globals/VerifyError.as @@ -0,0 +1,18 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/VerifyError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package +{ + public dynamic class VerifyError extends Error + { + prototype.name = "VerifyError"; + + public function VerifyError(message:String = "", id:int = 0) + { + super(message, id); + this.name = prototype.name; + } + } +} diff --git a/core/src/avm2/globals/flash/errors/EOFError.as b/core/src/avm2/globals/flash/errors/EOFError.as new file mode 100644 index 000000000..188f61513 --- /dev/null +++ b/core/src/avm2/globals/flash/errors/EOFError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/EOFError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package flash.errors +{ + + public dynamic class EOFError extends IOError + { + prototype.name = "EOFError"; + + public function EOFError(message:String = "", id:int = 0) + { + super(message, id); + } + + } +} + diff --git a/core/src/avm2/globals/flash/errors/IOError.as b/core/src/avm2/globals/flash/errors/IOError.as new file mode 100644 index 000000000..04641a856 --- /dev/null +++ b/core/src/avm2/globals/flash/errors/IOError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/IOError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package flash.errors +{ + + public dynamic class IOError extends Error + { + prototype.name = "IOError"; + + public function IOError(message:String = "", id:int = 0) + { + super(message, id); + } + + } +} + diff --git a/core/src/avm2/globals/flash/errors/InvalidSWFError.as b/core/src/avm2/globals/flash/errors/InvalidSWFError.as new file mode 100644 index 000000000..4ac7641ea --- /dev/null +++ b/core/src/avm2/globals/flash/errors/InvalidSWFError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/InvalidSWFError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package flash.errors +{ + + public dynamic class InvalidSWFError extends Error + { + prototype.name = "InvalidSWFError"; + + public function InvalidSWFError(message:String = "", id:int = 0) + { + super(message, id); + } + + } +} + diff --git a/core/src/avm2/globals/flash/errors/MemoryError.as b/core/src/avm2/globals/flash/errors/MemoryError.as new file mode 100644 index 000000000..43bf2676a --- /dev/null +++ b/core/src/avm2/globals/flash/errors/MemoryError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/MemoryError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package flash.errors +{ + + public dynamic class MemoryError extends Error + { + prototype.name = "MemoryError"; + + public function MemoryError(message:String = "", id:int = 0) + { + super(message, id); + } + + } +} + diff --git a/core/src/avm2/globals/flash/errors/ScriptTimeoutError.as b/core/src/avm2/globals/flash/errors/ScriptTimeoutError.as new file mode 100644 index 000000000..0bffc4124 --- /dev/null +++ b/core/src/avm2/globals/flash/errors/ScriptTimeoutError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/ScriptTimeoutError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package flash.errors +{ + + public dynamic class ScriptTimeoutError extends Error + { + prototype.name = "ScriptTimeoutError"; + + public function ScriptTimeoutError(message:String = "", id:int = 0) + { + super(message, id); + } + + } +} + diff --git a/core/src/avm2/globals/flash/errors/StackOverflowError.as b/core/src/avm2/globals/flash/errors/StackOverflowError.as new file mode 100644 index 000000000..ed03fadd0 --- /dev/null +++ b/core/src/avm2/globals/flash/errors/StackOverflowError.as @@ -0,0 +1,20 @@ +// The initial version of this file was autogenerated from the official AS3 reference at +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/errors/StackOverflowError.html +// by https://github.com/golfinq/ActionScript_Event_Builder +// It won't be regenerated in the future, so feel free to edit and/or fix + +package flash.errors +{ + + public dynamic class StackOverflowError extends Error + { + prototype.name = "StackOverflowError"; + + public function StackOverflowError(message:String = "", id:int = 0) + { + super(message, id); + } + + } +} + diff --git a/core/src/avm2/globals/globals.as b/core/src/avm2/globals/globals.as index 8734340ff..a08756188 100644 --- a/core/src/avm2/globals/globals.as +++ b/core/src/avm2/globals/globals.as @@ -4,10 +4,16 @@ include "Error.as" include "ArgumentError.as" +include "DefinitionError.as" +include "EvalError.as" include "TypeError.as" include "Math.as" include "RangeError.as" include "ReferenceError.as" +include "SecurityError.as" +include "SyntaxError.as" +include "URIError.as" +include "VerifyError.as" include "flash/accessibility/AccessibilityProperties.as" include "flash/crypto.as" @@ -107,7 +113,13 @@ include "flash/events/TimerEvent.as" include "flash/events/UncaughtErrorEvent.as" include "flash/events/VideoEvent.as" include "flash/events/VideoTextureEvent.as" +include "flash/errors/IOError.as" +include "flash/errors/EOFError.as" include "flash/errors/IllegalOperationError.as" +include "flash/errors/InvalidSWFError.as" +include "flash/errors/MemoryError.as" +include "flash/errors/ScriptTimeoutError.as" +include "flash/errors/StackOverflowError.as" include "flash/filters/BitmapFilter.as" include "flash/filters/BitmapFilterQuality.as" diff --git a/tests/tests/regression_tests.rs b/tests/tests/regression_tests.rs index 0f209a389..6788a8905 100644 --- a/tests/tests/regression_tests.rs +++ b/tests/tests/regression_tests.rs @@ -291,6 +291,7 @@ swf_tests! { (as3_equals, "avm2/equals", 1), (as3_error_stack_trace, "avm2/error_stack_trace", 1), (as3_error_tostring, "avm2/error_tostring", 1), + (as3_error_tostring_more, "avm2/error_tostring_more", 1), (as3_es3_inheritance, "avm2/es3_inheritance", 1), (as3_es4_inheritance, "avm2/es4_inheritance", 1), (as3_es4_interfaces, "avm2/es4_interfaces", 1), diff --git a/tests/tests/swfs/avm2/error_tostring_more/Test.as b/tests/tests/swfs/avm2/error_tostring_more/Test.as new file mode 100644 index 000000000..509c84edf --- /dev/null +++ b/tests/tests/swfs/avm2/error_tostring_more/Test.as @@ -0,0 +1,102 @@ +package { + import flash.display.Sprite; + + public class Test extends Sprite {} +} + + +import flash.errors.IOError; + +import flash.errors.EOFError; +import flash.errors.InvalidSWFError; +import flash.errors.MemoryError; +import flash.errors.ScriptTimeoutError; +import flash.errors.StackOverflowError; + +trace("Class: " + DefinitionError); +trace("cls.prototype.name = " + DefinitionError.prototype.name); +var newErrorDefinitionError: DefinitionError = new DefinitionError("My Error", 42); +trace(newErrorDefinitionError.toString()); +trace(newErrorDefinitionError.name); +trace(newErrorDefinitionError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + EOFError); +trace("cls.prototype.name = " + EOFError.prototype.name); +var newErrorEOFError: EOFError = new EOFError("My Error", 42); +trace(newErrorEOFError.toString()); +trace(newErrorEOFError.name); +trace(newErrorEOFError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + EvalError); +trace("cls.prototype.name = " + EvalError.prototype.name); +var newErrorEvalError: EvalError = new EvalError("My Error", 42); +trace(newErrorEvalError.toString()); +trace(newErrorEvalError.name); +trace(newErrorEvalError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + IOError); +trace("cls.prototype.name = " + IOError.prototype.name); +var newErrorIOError: IOError = new IOError("My Error", 42); +trace(newErrorIOError.toString()); +trace(newErrorIOError.name); +trace(newErrorIOError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + InvalidSWFError); +trace("cls.prototype.name = " + InvalidSWFError.prototype.name); +var newErrorInvalidSWFError: InvalidSWFError = new InvalidSWFError("My Error", 42); +trace(newErrorInvalidSWFError.toString()); +trace(newErrorInvalidSWFError.name); +trace(newErrorInvalidSWFError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + MemoryError); +trace("cls.prototype.name = " + MemoryError.prototype.name); +var newErrorMemoryError: MemoryError = new MemoryError("My Error", 42); +trace(newErrorMemoryError.toString()); +trace(newErrorMemoryError.name); +trace(newErrorMemoryError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + ScriptTimeoutError); +trace("cls.prototype.name = " + ScriptTimeoutError.prototype.name); +var newErrorScriptTimeoutError: ScriptTimeoutError = new ScriptTimeoutError("My Error", 42); +trace(newErrorScriptTimeoutError.toString()); +trace(newErrorScriptTimeoutError.name); +trace(newErrorScriptTimeoutError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + StackOverflowError); +trace("cls.prototype.name = " + StackOverflowError.prototype.name); +var newErrorStackOverflowError: StackOverflowError = new StackOverflowError("My Error", 42); +trace(newErrorStackOverflowError.toString()); +trace(newErrorStackOverflowError.name); +trace(newErrorStackOverflowError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + URIError); +trace("cls.prototype.name = " + URIError.prototype.name); +var newErrorURIError: URIError = new URIError("My Error", 42); +trace(newErrorURIError.toString()); +trace(newErrorURIError.name); +trace(newErrorURIError.errorID); +trace(); +trace(); +trace(); +trace("Class: " + VerifyError); +trace("cls.prototype.name = " + VerifyError.prototype.name); +var newErrorVerifyError: VerifyError = new VerifyError("My Error", 42); +trace(newErrorVerifyError.toString()); +trace(newErrorVerifyError.name); +trace(newErrorVerifyError.errorID); diff --git a/tests/tests/swfs/avm2/error_tostring_more/output.txt b/tests/tests/swfs/avm2/error_tostring_more/output.txt new file mode 100644 index 000000000..b940a5e9c --- /dev/null +++ b/tests/tests/swfs/avm2/error_tostring_more/output.txt @@ -0,0 +1,77 @@ +Class: [class DefinitionError] +cls.prototype.name = DefinitionError +DefinitionError: My Error +DefinitionError +42 + + + +Class: [class EOFError] +cls.prototype.name = EOFError +Error: My Error +Error +42 + + + +Class: [class EvalError] +cls.prototype.name = EvalError +EvalError: My Error +EvalError +42 + + + +Class: [class IOError] +cls.prototype.name = IOError +Error: My Error +Error +42 + + + +Class: [class InvalidSWFError] +cls.prototype.name = InvalidSWFError +Error: My Error +Error +42 + + + +Class: [class MemoryError] +cls.prototype.name = MemoryError +Error: My Error +Error +42 + + + +Class: [class ScriptTimeoutError] +cls.prototype.name = ScriptTimeoutError +Error: My Error +Error +42 + + + +Class: [class StackOverflowError] +cls.prototype.name = StackOverflowError +Error: My Error +Error +42 + + + +Class: [class URIError] +cls.prototype.name = URIError +URIError: My Error +URIError +42 + + + +Class: [class VerifyError] +cls.prototype.name = VerifyError +VerifyError: My Error +VerifyError +42 \ No newline at end of file diff --git a/tests/tests/swfs/avm2/error_tostring_more/test.swf b/tests/tests/swfs/avm2/error_tostring_more/test.swf new file mode 100644 index 000000000..82f8b9260 Binary files /dev/null and b/tests/tests/swfs/avm2/error_tostring_more/test.swf differ