Commit Graph

1391 Commits

Author SHA1 Message Date
ef37986541 Update more parity-wasm 2019-02-04 22:06:10 -08:00
e20c4067dc futures: Add a test for creating multiple futures from the same promise 2019-02-04 16:38:21 +01:00
4a50d7b71c Update parity-wasm requirement from 0.35 to 0.36
Updates the requirements on [parity-wasm](https://github.com/paritytech/parity-wasm) to permit the latest version.
- [Release notes](https://github.com/paritytech/parity-wasm/releases)
- [Commits](https://github.com/paritytech/parity-wasm/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 08:30:40 +00:00
e4294babeb Simplifying the error handling code 2019-02-04 02:08:08 +01:00
8b6e951e34 Adding in Reflect::get_f64, Reflect::get_u32, Reflect::set_f64, and Reflect::set_u32 2019-02-04 01:32:43 +01:00
fb8e158c9b remove unnecessary changes 2019-02-03 22:44:27 +09:00
51f7756e83 add #[allow(clippy::*)] to 901 line 2019-02-03 22:40:24 +09:00
d3a523439e comment out the all #[allow(clippy::*)] lines 2019-02-03 13:55:57 +09:00
223054811d fixed conflict 2019-02-03 13:49:42 +09:00
2e80313aa3 Merge pull request #1221 from rhysd/format-dts-file
Format .d.ts file
2019-02-01 09:24:49 -06:00
6e2f10440e give 2 space indentations to each enum variant 2019-02-01 16:25:25 +09:00
a1995cafd4 remove unnecessary blank lines in .d.ts file 2019-02-01 16:07:31 +09:00
23ccd3b5c1 remove unnecessary space before function name in .d.ts file 2019-02-01 16:07:12 +09:00
019a0863c4 give class members 2 spaces indentation in .d.ts files 2019-02-01 15:45:01 +09:00
965bd8c9fa Clean up 2019-01-31 07:32:12 -05:00
9224455077 Support Option with custom enums in JS
Find a hole automatically to use a sentinel value for `None`, and then
just wire everything up!

Closes #1198
2019-01-28 14:27:57 -08:00
c35d6f4b0a Fix conditional #[wasm_bindgen] in impls
Reported in #1191 the fix requires us to get a bit creative I think. The
general gist is that a block like this:

    #[wasm_bindgen]
    impl Foo {
        pub fn foo() {}
    }

was previously expanded all in one go. Now, however, it's expanded into:

    impl Foo {
        #[__wasm_bindgen_class_marker(Foo = "Foo")]
        pub fn foo() {}
    }

    // goop generated by orginal #[wasm_bindgen]

This method of expansion takes advantage of rustc's recursive expansion
feature. It also allows us to expand `impl` blocks and allow inner items
to not be fully expanded yet, such as still having `#[cfg]` attributes
(like in the original bug report).

We use theinternal `__wasm_bindgen_class_marker` to indicate that we're
parsing an `ImplItemMethod` unconditionally, and then generation
proceeds as usual. The only final catch is that when we're expanding in
an `impl` block we have to generate tokens for the `Program`
(wasm-bindgen injected goop like the custom section) inside the body
of the function itself instead of next to it. Otherwise we'd get syntax
errors inside of impl blocks!

Closes #1191
2019-01-28 12:29:01 -08:00
fa1d51fe44 Comment out WebGl tests 2019-01-26 12:19:28 -05:00
2e6880c43c Whitelist WebGlRenderingContext float slices 2019-01-26 12:10:08 -05:00
e19306c6a9 add #[allow(clippy::*)] in the top-level items 2019-01-25 14:44:10 +09:00
2a6d2004e1 minor typo in js-sys lib.rs 2019-01-24 15:35:21 -08:00
3300301b3f add '| undefined' to optional types in generated .d.ts 2019-01-23 20:49:52 +09:00
048a22bc77 Fix idl_type swap 2019-01-22 21:35:22 -05:00
48b64f4cfe Remove test file 2019-01-21 19:24:37 -05:00
1738f0772c Add immutable field to IdlType::Float32Array 2019-01-21 19:18:35 -05:00
216b4e36ff Rename immutable slices test 2019-01-21 16:59:02 -05:00
e6971cee34 Add failing immutable slice test 2019-01-21 16:59:02 -05:00
459639137c Add maybe adjust function 2019-01-21 16:59:01 -05:00
78c4075e40 Bump to 0.2.33 2019-01-18 15:32:17 -08:00
ba732a8a72 Merge pull request #1161 from derekdreery/debug_output
Better output from `impl Debug for JsValue`.
2019-01-17 16:52:13 -08:00
867b13b65e remove array check 2019-01-17 21:07:23 +00:00
d79ca22234 Merge pull request #1190 from sagan-software/issue-1186
js-sys: JSON::stringify_with_replacer[_and_space]
2019-01-16 16:38:59 -08:00
6226e6959f js-sys: JSON::stringify_with_replacer[_and_space]
This commit adds two new externs for `JSON.stringify`:
`JSON::stringify_with_replacer` and
`JSON::stringify_with_replacer_and_space`.

Fixes #1186
2019-01-16 18:03:03 -05:00
31fdede9fc Bump to 0.2.32 2019-01-16 13:11:13 -08:00
b0906fddba Better recognition of error type. 2019-01-16 15:36:13 +00:00
5f2ba3f98e Add better support for errors. 2019-01-16 10:46:26 +00:00
5bffc28631 Add a proper test.
And fix loads of bugs.
2019-01-16 10:16:29 +00:00
b60d82a531 Implement suggestings from @fitzgen. 2019-01-16 10:16:29 +00:00
72765757ef Fix tests again. 2019-01-16 10:16:29 +00:00
126efd5a95 Redo as js function + fix tests 2019-01-16 10:16:29 +00:00
5b51d279b4 Use toString where JSON.stringify didn't work 2019-01-16 10:16:29 +00:00
34bab511e5 Use JSON serialization to get better debug printouts. 2019-01-16 10:16:29 +00:00
41eefa7425 wasm-bindgen-test: Capture more console logging methods' output
Fixes #1183
2019-01-15 14:05:22 -08:00
8d6839878e fix missing semicolons to struct fields in .d.ts
TypeScript class property requires semicolon at the end:
    https://www.typescriptlang.org/docs/handbook/classes.html
2019-01-15 17:45:11 +09:00
715b4f4ced Merge pull request #1179 from alexcrichton/catch-all-errors
In debug mode log all imported uncaught exceptions
2019-01-14 17:28:15 -08:00
f2f11a01a2 In debug mode log all imported uncaught exceptions
This commit updates the `--debug` output of `wasm-bindgen` from the CLI
to catch all JS exceptions from imported functions, log such, and then
rethrow. It's hoped that this can be used when necessary to learn more
information about thrown exceptions and where an uncaught exception
could be causing issues with Rust code.

Closes #1176
2019-01-14 15:59:31 -08:00
5c04427382 Merge pull request #1175 from alexcrichton/internal-consistency
Fix an issue where closure rewriting required class internals
2019-01-14 15:53:40 -08:00
20e871f676 Fix an issue where closure rewriting required class internals
Surfaced through previous sanity-checking commits, this reorders some
internal operations to...

Closes #1174
2019-01-14 15:53:29 -08:00
b21489368c Ensure internal exported_classes map is consistent
Throw it in an `Option` and then `take()` it when we consume it to
ensure that future calls to insert data into it panic instead of
producing inconsistent JS.
2019-01-14 15:53:29 -08:00
f2cbbb83f3 wasm-bindgen-test: ignore example code that is not intended to compile
This was making `cargo test --all` fail.
2019-01-14 14:53:46 -08:00