Commit Graph

229 Commits

Author SHA1 Message Date
Nathan Adams 40cdb84656 tests: Add test for avm1 Function(foo) 2020-09-03 17:01:20 -07:00
Mike Welsh 2da3c0d319 tests: Add hitTest shapeflag test 2020-09-02 17:51:55 -07:00
Nathan Adams 9dfc20e1ba avm1: Implement Date.UTC 2020-09-02 17:12:31 -07:00
Nathan Adams 86eb6f2e50 avm1: Implement Date - #249 2020-09-02 17:12:31 -07:00
Mike Welsh 537cca7c38 tests: Add test for #1086 2020-09-02 13:25:53 -07:00
CUB3D a2c151677b core: Add blurFilter and test 2020-09-02 10:59:00 -07:00
CUB3D d1ad095bad core: Add tests for bitmap_filter 2020-09-02 10:59:00 -07:00
kmeisthax 559bc05b6a
avm2: Implement avm2 math opcodes (merge #1037)
* Implement `add`, with tests.

* Implement `add_i`.

There's no test, because for whatever reason, I can't figure out how to emit this from Animate CC 2020.

* avm2: Implement `bitand` with tests.

* Implement `bitnot` with tests.

* Implement `bitor` with tests.

* avm2: Implement `bitxor`

* avm2: Implement `declocal`, `declocal_i`, `decrement`, and `decrement_i`.

* tests: `swf_approx` tests should be allowed to print NaNs.

* avm2: Implement `divide`.

* avm2: Implement `inclocal`, `inclocal_i`, `increment`, and `increment_i`.

* avm2: Implement `lshift`.

* Implement `modulo`.

* avm2: Implement `multiply` and `multiply_i` (no tests for the latter)

* avm2: Implement `negate` and `negate_i` (no tests for the latter)

* avm2: Implement `rshift`

* avm2: Implement `subtract` and `subtract_i` (the latter without tests)

* avm2: Implement `urshift`.
2020-08-23 13:38:38 -07:00
Mike Welsh 528b52ac7c tests: Activate unused remove_movie_clip test 2020-08-21 00:55:35 -07:00
Mike Welsh bbc5e01009 tests: Add test for targetPath action 2020-08-20 18:14:01 -07:00
Mike Welsh e9f9cda34d tests: Rename target_path test to string_path 2020-08-20 18:14:01 -07:00
Mike Welsh b8f5a405b9 tests: Add test for flash.geom.Transform 2020-08-20 17:29:04 -07:00
Mike Welsh 544c1becc2 tests: Add test for button children 2020-08-18 01:18:15 -07:00
Mike Welsh b5c7e1dab0 tests: Add test for conflicting instance names 2020-08-18 01:18:15 -07:00
Albert Safin e03373bceb avm1: parseInt 2020-08-13 00:40:20 -07:00
David Wendt 354b194b69 avm1: Add test for nested text fields in buttons. 2020-08-12 11:08:27 -07:00
David Wendt 6ec1d453b8 Add tests for `greaterequals`, `greaterthan`, `lessequals`, and `lessthan`. 2020-08-10 16:38:04 -07:00
David Wendt f88f2e225a Add tests for `>`, `<`, `<=`, and `>=`.
Note that this does NOT completely test the full range of if instructions for abstract relational comparison. Notably, the Adobe Animate CC compiler compiles each operator into it's negated equivalent, e.g. `<` becomes `ifnlt`.

I do not know how to get it to emit `ifge` or the like, which differ only by how they handle `NaN`s.
2020-08-10 16:38:04 -07:00
David Wendt 76ab8570e4 Implement and test `equals`.
The test is also far more in-depth than the `if_eq`/`if_ne` tests, which use the same set of vectors as the strict-equality tests from a while ago. Interestingly, this test passed on first run
2020-08-10 16:38:04 -07:00
David Wendt 5da4e2f118 Test for `iseq` and `isne` 2020-08-10 16:38:04 -07:00
David Wendt 86965eb674 Test for `coerce_s`.
I cannot yet figure out how to generate tests that use `convert_s`, so it's not covered.
2020-08-10 16:38:04 -07:00
David Wendt 35f939cb15 Add and test for `convert_u` using `ToUint32` from ECMA-262 2020-08-10 16:38:04 -07:00
David Wendt 6eb41035cf Add & test ECMA-262 ToInt32 and `convert_i` opcode.
The ECMA-262 documentation is awfully overwrought for something that boils down to "chop off the non-whole part, wrap to 32 bits, then reinterpret as signed". Bitwise operations are *hell* to describe mathematically, and such descriptions are even harder to understand.
2020-08-10 16:38:04 -07:00
David Wendt 351fe026e9 Add a test for all the above numerical coercions. 2020-08-10 16:38:04 -07:00
David Wendt 60f9613365 Implement and test for `convert_b`. 2020-08-10 16:38:04 -07:00
David Wendt 6cf48eb543 Implement and test `not`. 2020-08-10 16:38:04 -07:00
David Wendt b972c24f7e Oh look, I figured out how to emit `istrue`, so that's tested, too. 2020-08-10 16:38:04 -07:00
David Wendt 850ebc88a2 Add test for truthiness.
As compiled by Adobe Animate CC 2020, this test appears to only use `iffalse`. However, both `op_is_false` and `op_is_true` coerce in the same manner, so I'm not entirely sure this is a problem for now.
2020-08-10 16:38:04 -07:00
unknown 795cd72dce avm1: Broadcasting functions are now copied from AsBroadcaster 2020-07-29 15:24:23 -07:00
unknown 890dc0ea13 avm1: Implement AsBroadcaster 2020-07-29 15:24:23 -07:00
Nathan Adams 32be19da6d avm1: Allow gotoAndStop/gotoAndPlay with frame numbers in paths - #915 2020-07-29 13:53:57 -07:00
CUB3D 49bee3fe5c core: Implement Object() function 2020-07-29 13:52:51 -07:00
CUB3D c1771d7d4e core: Split function and constructor, tests, fix bug with constructor 2020-07-27 12:50:31 -07:00
CUB3D afb1d6b42f core: Add global Array() function 2020-07-27 12:50:31 -07:00
CUB3D 22db5ab76a core: Populate function when creating a constructor 2020-07-27 10:38:50 -07:00
Nathan Adams cf61f8a4d3 avm1: Add failing test for registerClass in a loaded movie 2020-07-27 01:40:28 -07:00
David Wendt f56d16a68d Separate player creation from root movie setup, and allow users of Ruffle to load in movies synchronously or asynchronously.
During the small period of time when a player is created but has no root movie, a temporary empty movie is installed with an assumed stage size and framerate of 550x400@12fps. This is Flash default for new projects, so it seemed appropriate. User ActionScript cannot see these values, and I'm not even sure JavaScript can, either.
2020-07-23 23:02:51 -04:00
Mike Welsh efa059ff8d tests: Add test for LoadVars 2020-07-23 03:00:19 -07:00
Nathan Adams d5deeee1b7 avm1: Properly implement the arguments object, it's an array 2020-07-21 07:49:00 -07:00
David Wendt 64e5b46259 Add tests for `instanceof` and `is` operators. 2020-07-13 17:45:10 -04:00
David Wendt 563a515189 Add a test for loading interfaces into the AVM2.
This test will fail if the AVM2 implementation does not support bodyless methods or bare classes properly.
2020-07-13 17:45:07 -04:00
David Wendt 6117288fe2 Add tests for `ifstricteq`, `ifstrictne`, and `strictequals`. 2020-07-13 17:44:59 -04:00
David Wendt 03a240ebcd Add tests for `valueOf`. 2020-07-13 17:44:58 -04:00
David Wendt 3b52dfe2ba Since we have an `es3_inheritance` test now, rename the existing inheritance test to `es4_inheritance`. 2020-07-13 17:44:57 -04:00
David Wendt cf6714d33c Implement and test `toLocaleString`.
This function has vague documentation about enabling locale-specific formatting in subclasses. As far as I can tell, none of the objects I implemented so far do anything different than `toString`, so I just have it use the same `TObject` property I set up for `toString`.
2020-07-13 17:44:57 -04:00
David Wendt 3558c3afa0 Add test of `Function.prototype.call` 2020-07-13 17:44:56 -04:00
David Wendt 16774aa055 Add a test for legacy / ES3 inheritance.
This was originally something *way* more evil: mixed inheritance between ES3 and ES4 classes. It didn't pan out due to fundamental limitations of the two object models. How the hell did Brendan Eich/Adobe/TC-39 expect ES4 classes to be adopted in already-existing codebases?!
2020-07-13 17:44:56 -04:00
David Wendt 37cdcb3bce Add tests for `toString` on objects, functions, and classes. 2020-07-13 17:44:54 -04:00
David Wendt ba2c1f5750 Add test for `setPropertyIsEnumerable` 2020-07-13 17:44:39 -04:00
David Wendt dc0cb00a03 Add a test for `propertyIsEnumerable`. 2020-07-13 17:44:37 -04:00