Commit Graph

5850 Commits

Author SHA1 Message Date
lukaszN d5588f3f90 avm2: String refactor index_of, match 2021-09-18 18:37:46 +02:00
lukaszN 42300d4a1e avm2: String tests 2021-09-18 18:37:46 +02:00
lukaszN 4abde1500b avm2: String fixes for tests 2021-09-18 18:37:46 +02:00
lukaszN e24390ff58 avm2: String slice, substr, substring 2021-09-18 18:37:46 +02:00
lukaszN d953fea5df avm2: String match 2021-09-18 18:37:46 +02:00
lukaszN 91d63e4dc1 avm2: class methods can also live in the AS3 namespace 2021-09-18 18:37:46 +02:00
lukaszN 5e5d8e4fff avm2: String concat, lastIndexOf, indexOf, fromCharCode 2021-09-18 18:37:46 +02:00
relrelb 1ab953887c avm1: Simplify `Value::abstract_eq`
Make it return `bool` instead of a `Value` that can be either `true`
or `false`.
2021-09-18 17:47:25 +02:00
Giles Cope 623654cd99 Adding back getrandom 2021-09-18 15:28:24 +02:00
Giles Cope 42c2b40052 unused deps 2021-09-18 15:28:24 +02:00
Chris Midgley 758d84f549 avm2: fix button typo 2021-09-18 15:26:52 +02:00
Chris Midgley 909428943b avm2: implement bkpt, bkptline, timestamp as no-ops 2021-09-17 23:06:59 +02:00
relrelb ff1c29d952 avm1: Simplify `Value::abstract_lt`
* Change its return type to `Option<bool>`.
* Use Rust's `f64::partial_cmp` to compare two numbers, which should
be more efficient.
2021-09-16 13:46:04 +03:00
relrelb 08b6cf543a web: Guard logs behind a `log_enabled!()` macro
These logs perform somewhat expensive evaluation (crossing the Wasm-
JS boundary). So use the cheaper `log_enabled!()` macro to avoid
evaluation if the relevant log level is not enabled.
2021-09-16 02:56:18 -07:00
Chris Midgley 2dd83c23e8 avm2: add more opcodes
Taken from https://jindrapetrik.github.io/as3_pcode_instructions.en.html
2021-09-16 02:51:04 -07:00
Chris Midgley d52a350b9b avm2: reorder opcodes to be alphabetical 2021-09-16 02:51:04 -07:00
relrelb 818bf0809d tests: Add math_min_max 2021-09-16 02:38:34 -07:00
relrelb f92926af54 avm1: Correct `Math.{min,max}`
Don't use `abstract_lt` because it compares strings alphabetically,
unlike `Math.min` and `Math.max` that coerce to a number before comparing.
2021-09-16 02:38:34 -07:00
Chris Midgley 384d04536f dev: optimize file sizes for pngs and svgs
Run pngs through optipng and svgs through svgo.
2021-09-16 02:37:11 -07:00
relrelb 2e8a177bef web: Indent using spaces in tsconfig.json 2021-09-15 00:42:17 +03:00
Daniel Jacobs 56e8dd1b0e demo: Add visual indicator to file picker for dragging and dropping 2021-09-15 00:08:16 +03:00
Seedgou 5933107fd7 docs: vectorize logo image 2021-09-14 23:43:45 +03:00
Mike Welsh a882f85d14 chore: Bump TypeScript config to es2017 2021-09-13 14:54:17 -07:00
dependabot[bot] 76f4b0d8cd build(deps): bump flate2 from 1.0.21 to 1.0.22
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.21 to 1.0.22.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.21...1.0.22)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 14:27:26 -07:00
dependabot[bot] 74a08ce459 build(deps): bump embed-resource from 1.6.3 to 1.6.4
Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases)
- [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.6.3...v1.6.4)

---
updated-dependencies:
- dependency-name: embed-resource
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 14:27:02 -07:00
Moulins 73bce495c2 chore: move core::avm1::string::AvmString to core::string::AvmString 2021-09-13 03:30:17 -07:00
Moulins 87e8b44fe9 chore: move core::string_utils to core::string::utils
Also move case tables to a separate file.
2021-09-13 03:30:17 -07:00
Tal Hayon 72a811ae2c web: support no trailing slash in base parameter 2021-09-12 16:02:29 -07:00
Toad06 cee85cb057
chore: Improve the issue template
Use YAML syntax.
2021-09-12 12:50:57 -07:00
Mike Welsh d84f65874e chore: Appease clippy
Debug/Clone dervies no longer squelch dead code warnings, see:
See https://github.com/rust-lang/rust/pull/85200
2021-09-11 21:50:52 -07:00
Mike Welsh e3c05a021e core: De-duplicate enums between Avm1Button and Avm2Button
Needed to appease clippy.
2021-09-11 21:50:52 -07:00
Chris Midgley 2abea5aeba
web: don't panic if failing to create an audio buffer 2021-09-11 15:48:30 -07:00
Ray Redondo 167b5a45de avm2: move flash.display.IBitmapDrawable init 2021-09-11 15:47:20 -07:00
Ray Redondo 40d53cda59 avm2: make BitmapData and DisplayObject impl IBitmapDrawable 2021-09-11 15:47:20 -07:00
Ray Redondo 7f895473cb avm2: IBitmapDrawable stub 2021-09-11 15:47:20 -07:00
Daniel Jacobs 2213e7d012 web: Menu embed/object attribute true value is case-insensitive 2021-09-11 14:25:52 -07:00
David Wendt 1e0d259075 avm2: Allow nulling `Bitmap.bitmapData`.
One of the two tests in this PR relies upon the backend storing bitmap data, but the test rendering backend does not yet do this.
2021-09-11 12:11:35 -07:00
David Wendt bfb6f03d62 avm2: Impl `Bitmap.smoothing`
Also, `smoothing` should be set at construction time even if we're setting up a timeline bitmap.
2021-09-11 12:11:35 -07:00
David Wendt 2ba0e12b7e avm2: Stub `Bitmap.pixelSmoothing` 2021-09-11 12:11:35 -07:00
David Wendt 8ae669b96c avm2: `BitmapData` should be traceable 2021-09-11 12:11:35 -07:00
David Wendt 31e3741982 avm2: Allow access to the `BitmapData` of a `Bitmap`. 2021-09-11 12:11:35 -07:00
David Wendt 7c5dc568f1 avm2: Impl `BitmapData.getPixel`.
This also changes the `bitmapdata_constr` test slightly to use a different starting value. Our premultiplied alpha calculations generate slightly different values from Flash Player which trips the test.
2021-09-11 12:11:35 -07:00
David Wendt 4c9bd0a6fe avm2: Impl `BitmapData.transparent` 2021-09-11 12:11:35 -07:00
David Wendt e18caa2fbf core: Silence error relating to `Bitmap` symbol class associations 2021-09-11 12:11:35 -07:00
David Wendt dca473fc2a avm2: Impl `BitmapData.width` and `BitmapData.height` 2021-09-11 12:11:35 -07:00
David Wendt 723b8b6756 tests: Add tests for `BitmapData`'s constructor, in both fresh and embedded bitmap contexts. 2021-09-11 12:11:35 -07:00
David Wendt 335aec5be0 avm2: Implement `BitmapData`'s constructor.
This includes support for both embedded bitmap data (resolved via the SymbolClass mechanism) as well as empty bitmaps configured via arguments.
2021-09-11 12:11:35 -07:00
David Wendt e5151d147d core: When constructing a `Bitmap`, do not attempt to cache it's associated `BitmapData`'s handle.
Attempting to do so results in borrow-mut panics. Furthermore, it's unnecessary; the handle provided to this function is already derived from the bitmap data in this way.
2021-09-11 12:11:35 -07:00
David Wendt 54740d6093 core: Allow `BitmapData` to hold an AVM2 side. 2021-09-11 12:11:35 -07:00
David Wendt 10b98f72f5 core: Allow `Bitmap` to be reassociated with new `BitmapData` 2021-09-11 12:11:35 -07:00