Commit Graph

1106 Commits

Author SHA1 Message Date
Mike Welsh 4eef8a1821 tests: Add test for ActionCall 2020-01-14 00:04:11 -08:00
Mike Welsh 2d3801dac8 avm1: Implement ActionCall opcode 2020-01-14 00:04:11 -08:00
Nathan Adams fdf1d38d21 avm1: Implement remainder of Math 2020-01-13 15:57:56 -08:00
Mike Welsh 0e228441e1 web: Add missing returns to RufflePlayer.local/local_compatible 2020-01-13 12:28:30 -08:00
Mike Welsh 79745feef7 chore: Use percent-encoding 2.1.0 2020-01-13 11:07:30 -08:00
dependabot-preview[bot] 52607d4706 build(deps): bump url from 2.1.0 to 2.1.1
Bumps [url](https://github.com/servo/rust-url) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:41:41 -08:00
dependabot-preview[bot] 00f7602604 build(deps): bump num-traits from 0.2.10 to 0.2.11
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.10 to 0.2.11.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.10...num-traits-0.2.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 18:38:33 +00:00
dependabot-preview[bot] 6c2f5143b3 build(deps): bump rand from 0.7.2 to 0.7.3
Bumps [rand](https://github.com/rust-random/rand) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 18:38:15 +00:00
dependabot-preview[bot] ec0599913d build(deps): bump walkdir from 2.2.9 to 2.3.1
Bumps [walkdir](https://github.com/BurntSushi/walkdir) from 2.2.9 to 2.3.1.
- [Release notes](https://github.com/BurntSushi/walkdir/releases)
- [Commits](https://github.com/BurntSushi/walkdir/compare/2.2.9...2.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 18:37:55 +00:00
dependabot-preview[bot] 6ff9fd21e3 build(deps): bump lyon from 0.15.3 to 0.15.5
Bumps [lyon](https://github.com/nical/lyon) from 0.15.3 to 0.15.5.
- [Release notes](https://github.com/nical/lyon/releases)
- [Changelog](https://github.com/nical/lyon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nical/lyon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 18:37:17 +00:00
Mike Welsh 82c366da7b
exntesion: Merge #236, fix extension build process
Use Webpack to build and package Ruffle WASM file in extension
2020-01-13 10:30:56 -08:00
David Wendt 51023145c8 Build the extension using webpack, the same as the local version. 2020-01-10 22:10:43 -05:00
Mike Welsh 001a931afe avm1: Avm1::pop should always succeed
Don't return a Result from `pop`. Instead, emit a warning and
return Undefined if there is an underflow.
2020-01-07 15:59:14 -08:00
dependabot-preview[bot] 102c4f9b03 build(deps): bump png from 0.15.2 to 0.15.3
Bumps [png](https://github.com/image-rs/image-png) from 0.15.2 to 0.15.3.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-07 18:35:51 +00:00
dependabot-preview[bot] 2600b6d73e build(deps): bump csv from 1.1.1 to 1.1.2
Bumps [csv](https://github.com/BurntSushi/rust-csv) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/BurntSushi/rust-csv/releases)
- [Commits](https://github.com/BurntSushi/rust-csv/compare/1.1.1...1.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-07 13:14:08 +00:00
Mike Welsh 170813ffbf audio: Assume little endian for PCM unknown endian sounds 2020-01-07 02:40:09 -08:00
dependabot-preview[bot] 0458884f08 build(deps): bump wasm-bindgen-test from 0.3.6 to 0.3.7
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-07 08:50:01 +00:00
Mike Welsh 6f32c1dc06 chore: Bump to lyon_tessellation 0.15.4 2020-01-06 23:20:02 -08:00
Mike Welsh a28e97d8c3 avm1: Don't push returns from non-function stack frames 2020-01-06 20:49:05 -08:00
Mike Welsh 7e05da6147 avm1: Fix issues with traversing the scope chain in SetVariable
When setting a variable in a function-local scope, if that variable
has not been defined in the function scope, it should be defined in
the executing movieclip's scope. Previously it would get defined
in the function's scope. Changed Scope::overwrite to Scope::set,
and modified the behavior to stop traversing and define the value
when it hits a movie clip Target scope.

Also, modified With scopes to properly add onto the end of the scope
chain.
2020-01-06 20:49:05 -08:00
Mike Welsh a60fadf0bb tests: Add test for correct scope in SetVariable 2020-01-06 20:49:05 -08:00
Mike Welsh ab63f221ed web: Bump to wasm-bindgen 0.2.57 2020-01-06 13:01:39 -08:00
Mike Welsh f576a39760 web: Fix must_use warning on AudioContext::decode_audio_data
web-sys 0.3.34 added `must_use` to `Promise`. Add `let _ =` to
squlech this warning.
2020-01-06 13:01:39 -08:00
dependabot-preview[bot] 5c4a180913 build(deps): bump web-sys from 0.3.33 to 0.3.34
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.33 to 0.3.34.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 13:01:39 -08:00
Mike Welsh bcc51f2dd8
avm1: Merge #205, XML support
Support for AVM1 XML and XMLNode objects.
2020-01-05 12:57:38 -08:00
David Wendt 0d1d0e8de7 Don't bother preserving the `Cow`ness of unescaped strings when we're going to clone them anyway. 2020-01-05 00:31:45 -05:00
David Wendt 7957434036 This is a copy type, copy it 2020-01-05 00:24:31 -05:00
David Wendt f8b5b8a032 Use `unwrap_or_default` where available 2020-01-05 00:22:36 -05:00
David Wendt ef7c5d7eb9 Move XML properties to separate functions rather than closures 2020-01-05 00:17:57 -05:00
David Wendt 14dba0d100 Log errors encountered when removing the children of a node we plan to parse XML into.
Also, remove a handful of unnecessary `#[allow(unused_must_use)]` instances.
2020-01-05 00:04:45 -05:00
David Wendt 464563a703 Change the no-double-introduction warning into a proper `assert!`. Add doc warning about the panic. 2020-01-05 00:00:29 -05:00
David Wendt 750e6e4370 Replace bare number constants for XML errors with symbolic `const` values 2020-01-04 23:56:10 -05:00
David Wendt fd541fabea Implement `status`.
I'm not entirely sure how to test this one - the list of errors that Flash kicks out for XML and the list of errors that `quick_xml` kicks out don't line up at all; so I just ensured that any error is a negative number (currently the one for OOM errors) and stuck whatever errors *did* match up together.

Consequently I don't know entirely *how* to write tests for this.
2020-01-04 19:00:49 -05:00
David Wendt fec95dd226 Add regression test for `idMap`. 2020-01-04 19:00:49 -05:00
David Wendt f3226537bf Implement `idMap`.
`idMap` is a strange property; it's only populated with nodes which had a given `id` *at the time of parsing*, and said nodes continue to be referenced even if the node is removed from the document. I have yet to find a way by which nodes can be deleted from `idMap`.

It also takes expandos, so this has to be a new retained object on the XML document. I originally considered not creating *another* `Object` impl and populating a regular `ScriptObject` with nodes, but that meant we couldn't lazy-instantiate their AVM1 side counterparts. Boo. :/
2020-01-04 19:00:48 -05:00
David Wendt 1722558d44 Add test for `XML.parseXML` 2020-01-04 19:00:47 -05:00
David Wendt 823e8602ff Impl `XML.parseXML` 2020-01-04 19:00:46 -05:00
David Wendt d00ef01965 Add a convenience method: `XMLNode.into_string` 2020-01-04 19:00:46 -05:00
David Wendt b4b722e1d6 Add another test for AVM1 XML's failure to roundtrip unsupported node types (e.g. comments). 2020-01-04 19:00:45 -05:00
David Wendt 2c790f1d41 Filter non-AS2 compatible nodes from toString output, and add non-SWF tests for XML filtering. 2020-01-04 19:00:45 -05:00
David Wendt ce1b958abb Add some more tests for XML namespace URIs. 2020-01-04 19:00:45 -05:00
David Wendt e2fa685d41 Fix tagname parsing.
There is a bug in `quick_xml` - or at least, I *think* it's a bug - where the `unescaped` method of `BytesStart` yields a bunch of attributes if you have slightly invalid crap in your tag like `xmlns:`. To work around it, I turned off unescaping; we're instead using `name` and ignoring unescaping. This will probably fail somewhere.
2020-01-04 19:00:44 -05:00
David Wendt e1034fce31 clippy compliance 2020-01-04 19:00:44 -05:00
David Wendt 7ac3204759 format prev commit 2020-01-04 19:00:43 -05:00
David Wendt d2aa3dd987 Add a test for `createElement` and `createTextNode`. 2020-01-04 19:00:43 -05:00
David Wendt db38982ffb For some reason, text nodes have an attributes object. 2020-01-04 19:00:42 -05:00
David Wendt 91155d6870 Text nodes have empty arrays for `childNodes` rather than being `undefined`. 2020-01-04 19:00:42 -05:00
David Wendt d28094a019 Implement `createElement` and `createTextNode`. 2020-01-04 19:00:42 -05:00
David Wendt 97bcb6b2dc Add an ignored test for `xmlDecl`.
Test is currently ignored because AS2 XML currently handles XML declarations in ways not compatible with our current parser. Investigating hacky ways around this.
2020-01-04 19:00:41 -05:00
David Wendt c02da74afa Expose the `<?xml ?>` declaration to ActionScript.
I can't write proper tests for this because our underlying XML parsing technology doesn't let us do what AS2 XML does: just copy the first xml tag out of the document and into a string. No, seriously, anything at the start of the parsed XML that starts with `<?xml` and ends with `?>` gets copied into Flash's moral equivalent of `xml::Document` as a string. We parse the whole thing, which is wrong, so we'll need to additionally retain the original xmldecl string in order to pass the test I wrote for this.
2020-01-04 19:00:41 -05:00