wasm-bindgen/crates/webidl-tests
Alex Crichton d6e48195b3 Implement support for WebIDL dictionaries
This commit adds support for generating bindings for dictionaries defined in
WebIDL. Dictionaries are associative arrays which are simply objects in JS with
named keys and some values. In Rust given a dictionary like:

    dictionary Foo {
        long field;
    };

we'll generate a struct like:

    pub struct Foo {
        obj: js_sys::Object,
    }

    impl Foo {
        pub fn new() -> Foo { /* make a blank object */ }

        pub fn field(&mut self, val: i32) -> &mut Self {
            // set the field using `js_sys::Reflect`
        }
    }

    // plus a bunch of AsRef, From, and wasm abi impls

At the same time this adds support for partial dictionaries and dictionary
inheritance. All dictionary fields are optional by default and hence only have
builder-style setters, but dictionaries can also have required fields. Required
fields are exposed as arguments to the `new` constructor.

Closes #241
2018-08-15 17:08:27 -07:00
..
array_buffer.js Add WebIDL support for the ArrayBuffer type 2018-08-04 16:34:12 -05:00
array_buffer.rs Add WebIDL support for the ArrayBuffer type 2018-08-04 16:34:12 -05:00
array_buffer.webidl Add WebIDL support for the ArrayBuffer type 2018-08-04 16:34:12 -05:00
array.js Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
array.rs Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
array.webidl Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
build.rs Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
Cargo.toml Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
consts.js Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
consts.rs Generate const mixin bindings 2018-08-13 21:58:40 -07:00
consts.webidl Generate const mixin bindings 2018-08-13 21:58:40 -07:00
dictionary.js Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
dictionary.rs Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
dictionary.webidl Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
enums.js Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
enums.rs Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
enums.webidl Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
lib.rs Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
main.rs Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
namespace.js Merge branch 'master' of https://github.com/rustwasm/wasm-bindgen 2018-08-13 18:59:52 +03:00
namespace.rs Merge branch 'master' of https://github.com/rustwasm/wasm-bindgen 2018-08-13 18:59:52 +03:00
namespace.webidl Fix console test 2018-08-13 20:09:18 +03:00
simple.js Add OptionalAndUnionArguments test 2018-08-13 23:18:16 +03:00
simple.rs Add OptionalAndUnionArguments test 2018-08-13 23:18:16 +03:00
simple.webidl Add OptionalAndUnionArguments test 2018-08-13 23:18:16 +03:00
throws.js Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
throws.rs Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00
throws.webidl Migrate webidl tests to wasm_bindgen_test (#590) 2018-07-30 11:06:29 -07:00