Commit Graph

24 Commits

Author SHA1 Message Date
4eaa1a5639 Add support for more slice types in WebIDL
Add support for the primitive type arrays, and additionally switch `ByteString`
to `String` instead of `Vec<u8>` according to the online documentation.
2018-07-19 08:46:45 -07:00
a949482e3a Remove usage of #[wasm_custom_section] (#509)
This has been stabilized on nightly as `#[link_section]`, so no need for an
unstable attribute any more. Yay!
2018-07-19 08:57:18 -05:00
ed05c7b945 Fix compile on latest nightly (#489) 2018-07-17 09:11:30 -05:00
51b9eb81e8 split const integers into signed and unsigned 2018-07-14 22:48:37 +02:00
0c908bb951 Merge remote-tracking branch 'origin/master' into webidl_partial_mixins 2018-07-13 22:32:16 -07:00
d5fee8d5d1 webidl: move first pass logic to new module
I also updated it so that it is modeled in the same
extensible way as the WebidlParse trait.
2018-07-13 21:46:36 -07:00
9ebd8bc790 webidl: add float const test 2018-07-13 19:59:59 +02:00
473ac6d2ee webidl: add int const test 2018-07-13 19:59:52 +02:00
88f0e84f6c webidl: add bool const test 2018-07-13 19:59:44 +02:00
b23b9cce5b webidl: add empty constant test file 2018-07-13 19:59:37 +02:00
63598721ca rustfmt 2018-07-13 19:59:13 +02:00
5b952f2081 webidl: add support for partial interfaces and mixins
This is a major change to how webidl is processed. This adds
a two phase process, where the first phase records the names of
various types and indexes the mixins (and might do more in the
future). The actual program building happens in the second phase.

As part of this, this also makes it so that interface objects
are passed by reference, rather than by value. The spec isn't
exactly clear on this, but Mozilla's C++ reflection suggestions
seem to indicate that they should be passed by reference (see
https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings).
2018-07-11 19:25:16 -07:00
5520da1ef6 webidl: update enum test to unwrap constructor results
Update the enum test to match the new constructor return values
2018-07-11 16:17:56 -04:00
4c7b130872 Merge branch 'master' into feat/basic-enum-support 2018-07-11 15:34:00 -04:00
3cdb6ef03a webidl: Turn the [Throws] extended attributes into Result<T, JsValue>
This sets the `catch` flag on the emitted AST when an operation/attribute has
the `[Throws]` extended attribute on it.

Additionally, constructors aren't annotated with `[Throws]` but can still throw
exceptions, so we must conservatively assume *every* constructor can throw an
error.
2018-07-11 11:07:03 -07:00
a981dfd507 webidl: initial enum support
Add enum support to the WebIDL interface generator.
2018-07-10 20:28:34 -04:00
92dd8e859f Move webidl tests to the webidl crate's test suite (#451)
* webidl: Remove exact-output tests

These have not been as effective, nor as easy to write and maintain, as the
project()-based integration tests.

* tests: Move webidl tests into the webidl crate's test suite
2018-07-10 16:17:33 -05:00
791e69a5c0 Generate normal Rust functions for imported bindings (#410)
* Generate normal Rust functions for imported bindings

No need to use the C ABI, it just mixes up the documentation!

* Update expected webidl output
2018-07-07 12:20:42 -05:00
4ceaf3e0f4 Some small cleanups (#366)
* No need for version deps in dev-deps

These are all internal so we can drop the version

* Remove wasm-bindgen-cli's parity-wasm dep

No longer needed

* Tweak file hierarchy in webidl tests

Use Cargo's conventions to avoid the need to define `[[test]]` sections

* Remove unused imports
2018-07-02 11:57:39 -05:00
8faebc56f2 webidl: Add logging and use env_logger in the tests 2018-06-01 16:09:15 -07:00
7ea0a7cc26 webidl: emit methods for regular operations 2018-05-31 22:54:40 -07:00
a3d91bdd7c webidl: make writing new tests really easy 2018-05-30 15:45:01 -07:00
a30ccd7c18 webidl: Use Default for pub tokens (#215) 2018-05-30 15:07:20 -05:00
3879f6f427 Introduce the wasm-bindgen-webidl frontend
This is still a work in progress. Parse WebIDL source text and convert it into
wasm-bindgen AST, so that we can automatically emit bindings for the types and
functions described in the WebIDL.
2018-05-29 14:22:53 -07:00