Commit Graph

2820 Commits

Author SHA1 Message Date
f8680a0c10 remove is array function 2019-01-17 21:08:32 +00:00
867b13b65e remove array check 2019-01-17 21:07:23 +00:00
1d0c2fee9e Add failing immutable slice test 2019-01-17 13:20:56 -05:00
32c611d16d Convert all examples to using wasm-pack
This commit migrates all our examples to using `wasm-pack build` to
compile their code and run `wasm-bindgen`. This should make it a bit
easier to understand the examples as there's less to follow during the
build step.

Webpack projects are all using `@wasm-tool/wasm-pack-plugin` as well so
the build step is simple `npm run serve`. Other examples which retain
`build.sh` are just using `wasm-pack build` now
2019-01-17 08:37:32 -08:00
7fe76061af Update node to support Array.values in tests. 2019-01-17 12:59:16 +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
50d2422309 Merge pull request #1188 from fitzgen/bump-to-0.2.32
Bump to 0.2.32
0.2.32
2019-01-16 13:17:42 -08:00
31fdede9fc Bump to 0.2.32 2019-01-16 13:11:13 -08:00
86ef3f75dd Add 0.2.32 entry to CHANGELOG.md 2019-01-16 13:06:17 -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
f3dd38690a Remove Array.isArray test. 2019-01-16 10:16:29 +00:00
fab9d1dff6 Resolve what to do with no_std. 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
36cb50445f Make clear it's a JsValue. 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
0d3f9eb02b Merge pull request #1184 from fitzgen/issue-1183
wasm-bindgen-test: Capture more console logging methods' output
2019-01-15 14:25:46 -08:00
41eefa7425 wasm-bindgen-test: Capture more console logging methods' output
Fixes #1183
2019-01-15 14:05:22 -08:00
d5b6c5270b Merge pull request #1181 from rhysd/fix-dts-struct-fields
Fix missing semicolons at generated struct fields in .d.ts
2019-01-15 09:24:16 -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
1526d18ed6 Merge pull request #1178 from fitzgen/issue-1167
Some wasm-bindgen-test runtime fixes
2019-01-14 15:44:37 -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
56c4385f42 wasm-bindgen-test: Rename console_*_redirect to on_console_*
Since we are no longer redirecting all console logs, and are instead just
observing them.
2019-01-14 14:51:28 -08:00
a94f3f4403 wasm-bindgen-test: Have the test runner JS call the original console.log
This makes control flow a little easier to follow and avoids wasm->js->wasm
re-entrancy.
2019-01-14 14:51:28 -08:00
51ef19b85f wasm-bindgen-test: Use spread array arguments instead of arguments objects
Our testing runtime tries to call `Array.prototype.forEach` on this object, so
it had damn well better be a proper array!

Fixes #1167
2019-01-14 14:51:28 -08:00
177ef22673 Add maybe adjust function 2019-01-14 17:45:43 -05:00
c0ddabcca1 Sanity check exposed_globals map
Make sure that we don't actually try to expose something when they've
already been written, causing an internal tool panic rather than wrong
JS.
2019-01-14 13:09:05 -08:00
666c1e4584 Merge pull request #1169 from lcnr/master
fix spawn_local
2019-01-14 12:38:29 -08:00
6e08f579a6 add temporary test 2019-01-14 21:04:29 +01:00
4e611c318e fix spawn_local 2019-01-12 17:42:05 +01:00
12893183b6 Merge pull request #1164 from alexcrichton/fix-tests
Fix and execute wasm-bindgen-wasm-interpreter tests
2019-01-11 18:45:47 -08:00
1a10ecc8e7 Merge pull request #1152 from derekdreery/webidl_sequence
Use JsValue for webidl sequence.
2019-01-11 13:20:50 -08:00
61a6fcfced Fix and execute wasm-bindgen-wasm-interpreter tests 2019-01-11 13:20:08 -08:00
50ee0ab86c Merge pull request #1165 from alexcrichton/working-workspace
Exclude the `typescript` crate from the workspace
2019-01-11 12:49:54 -08:00
cb8bf9390d Implement webidl sequences. 2019-01-11 19:14:07 +00:00
ff3986aeb9 Exclude the typescript crate from the workspace
This'll help get `cargo build --all` and similar commands working. While
not critical at all, I execute it from time to time and it's a bummer
when it doesn't work!
2019-01-11 10:29:37 -08:00
6b13a865cb Merge pull request #1162 from rylev/remove-web-sys-bindings-list
Simply remove the web-sys bindings 'tested' list
2019-01-11 09:05:39 -08:00
c056235530 Simply remove the web-sys bindings 'tested' list 2019-01-10 19:06:11 +01:00
b04f60cf2b Bump to 0.2.31 0.2.31 2019-01-09 09:17:50 -08:00
f404182c47 Fix a typo 2019-01-07 11:00:15 -08:00