Commit Graph

3117 Commits

Author SHA1 Message Date
Alex Crichton
f1e8e2bee0 Remove GLOBAL_ARGUMENT_CNT JS binding
This is easier to manage statically so no need to track it dynamically
2018-04-03 12:38:33 -07:00
Alex Crichton
a805e04a81 Track next_global at codegen time
No need to track it at runtime as we should statically know its value!
2018-04-03 12:24:35 -07:00
Alex Crichton
8e5f5d20fc Remove accidental double braces 2018-04-03 12:24:19 -07:00
Alex Crichton
dd9c444aeb Try harder to debug failures.. 2018-04-03 09:34:37 -07:00
Alex Crichton
f77612531f Try to debug a failing test on AppVeyor 2018-04-03 08:46:02 -07:00
Alex Crichton
f60b5d9968 Typo! 2018-04-03 08:43:51 -07:00
Alex Crichton
6811059935 Add a link to Webpack's fix 2018-04-03 08:21:56 -07:00
Alex Crichton
76cc1ca295 Fix imports of TextEncoder/TextDecoder 2018-04-03 08:09:25 -07:00
Alex Crichton
bfde5e236c Add a CLI reference to the README 2018-04-03 07:58:42 -07:00
Alex Crichton
30b1964255 Bump all crates to 0.2 2018-04-03 07:10:07 -07:00
Alex Crichton
bb2e0c205f
Merge pull request #77 from dflemstr/wasm-construct-js-class
Add support for constructing JsValue instances generically
2018-04-03 16:08:30 +02:00
Alex Crichton
782378e7c0 Update dependencies 2018-04-03 07:07:14 -07:00
David Flemström
540ccfac9d Only generate JS class constructor export if import is needed 2018-04-03 11:28:25 +02:00
David Flemström
86625e78bc Fix tests that are missing wasm_import_module 2018-04-03 11:28:25 +02:00
Alex Crichton
03433a0ef6 Update to recent WasmBoundary abi changes 2018-04-02 09:59:08 -07:00
Alex Crichton
188d368583 Add some missing features to tests 2018-04-02 09:59:07 -07:00
David Flemström
73619b5d15 Add support for constructing JsValue instances generically 2018-04-02 09:59:01 -07:00
Alex Crichton
e6a483f906 Hurray for fun with hygiene! 2018-03-31 14:29:47 -07:00
Alex Crichton
f2254628dd Fix a typo 2018-03-31 14:26:00 -07:00
Alex Crichton
9bc2718943 Clean up a bit of duplication in codegen 2018-03-31 09:38:31 -07:00
Alex Crichton
7880545b3b Finish fixing fallout in all tests 2018-03-31 09:15:39 -07:00
Alex Crichton
2880247acf Get the imports test passing 2018-03-31 08:26:20 -07:00
Alex Crichton
cdbb31f3a9 Start removal of vector special-casing
This commit starts wasm-bindgen down a path of removing the special
casing it currently has around vectors, slices, and strings. This has
long been a thorn in wasm-bindgen's side as it doesn't handle other
kinds of vectors and otherwise is very inflexible with future additions.
Additionally it leads to a lot of duplicated-ish code throughout various
portions of codegen.

The fundamental reason for this was that two arguments were required to
be passed back to wasm, and I couldn't figure out a way to shove both
those arguments into a function argument. The new strategy here is that
there is one global stack well known to both JS and Rust which arguments
*may* also be transferred between.

By default all ABI arguments pass as literal function arguments, but if
two or more arguments need to be passed then the extra ones are all
passed through this global stack. The stack is effectively temporary
scratch space when crossing the JS/Rust boundary (both ways). No long
term storage is intended here.

The `simple` test is passing as a result of this commit, using strings
internally. The `Vector` type in the AST has been removed (yay!) and the
bulk of the implementation of slices and vectors now resides in the
`wasm-bindgen` crate itself, defining how to pass all these arguments
around. The JS generator, however, still needs to know about all the
sorts of vectors so it can generate appropriate code for JS.

Future commits will continue cleanup and get the rest of the tests
working.
2018-03-31 07:57:47 -07:00
Alex Crichton
25af16c7d9 Fix an unused mut warning 2018-03-31 02:35:09 -07:00
Alex Crichton
f86d227d51
Merge pull request #98 from corbinu/master
Fix import TextDecoder in output for nodejs config
2018-03-31 00:12:13 +02:00
Corbin Uselton
13520e324b Fix import TextDecoder in output for nodejs config 2018-03-30 10:50:01 -07:00
Alex Crichton
c97df46e08 Remove dummy test in backend 2018-03-29 14:51:00 -07:00
Alex Crichton
4e923445eb Remove executable bits 2018-03-29 14:50:40 -07:00
Alex Crichton
80243acc37 Fix running node tests 2018-03-29 14:49:36 -07:00
Ashley Williams
c525ecffc2 feat(test): add a failing math test 2018-03-29 22:29:39 +02:00
Alex Crichton
646df20d70 Fix a typo when running commands 2018-03-29 12:26:42 -07:00
Alex Crichton
afc43174d9
Merge pull request #95 from fitzgen/backend
Split out the AST and codegen into the wasm-bindgen-backend crate
2018-03-29 18:31:38 +02:00
Nick Fitzgerald
0bd54480c6 Split out the AST and codegen into the wasm-bindgen-backend crate 2018-03-29 09:14:32 -07:00
Alex Crichton
64dc1e8b45 Fix compilation of examples on Travis 2018-03-29 08:59:08 -07:00
Alex Crichton
3ceee55d14 Fix Travis (hopefully) 2018-03-29 08:50:08 -07:00
Alex Crichton
47da3a38a8
Merge pull request #94 from ashleygwilliams/node-modules
feat(enum): object.freeze the enum
2018-03-29 17:46:24 +02:00
Ashley Williams
3ed363ae39 feat(enum): object.freeze the enum 2018-03-29 17:30:28 +02:00
Alex Crichton
79ef5979f4
Merge pull request #93 from fitzgen/rename-directories
Rename directories to remove "wasm-bindgen-" prefix in sub-crates
2018-03-29 17:29:47 +02:00
Nick Fitzgerald
393841779a Rename directories to remove "wasm-bindgen-" prefix in sub-crates 2018-03-29 08:28:25 -07:00
Alex Crichton
95d38795a9
Merge pull request #91 from fitzgen/more-contrib
Update CONTRIBUTING.md
2018-03-29 17:28:03 +02:00
Nick Fitzgerald
1d186ebf14 Update CONTRIBUTING.md 2018-03-29 08:27:31 -07:00
Alex Crichton
31107db86d
Merge pull request #92 from ashleygwilliams/node-modules
feat(node): support node enums
2018-03-29 17:27:21 +02:00
Ashley Williams
ae51c3b6f7 feat(node): support node enums 2018-03-29 17:11:28 +02:00
Alex Crichton
0657cee698
Merge pull request #86 from ashleygwilliams/node-modules
Generate node.js `require` directives for `--nodejs`
2018-03-29 16:42:20 +02:00
Ashley Williams
256b34736e feat(node): support node classes 2018-03-29 16:08:50 +02:00
Alex Crichton
6347685976
Merge pull request #84 from ashleygwilliams/prereq-readme
doc(contributing): add a contributing.md
2018-03-29 13:19:38 +02:00
Alex Crichton
b21cfcc786
Merge pull request #85 from ashleygwilliams/no-yarn-lock
fix(ignore): ignore yarn.lock
2018-03-29 13:19:17 +02:00
Ashley Williams
61ea1b4b00 fix(ignore): ignore yarn.lock 2018-03-29 11:22:06 +02:00
Ashley Williams
2e5b6a28d3 doc(contributing): add a contributing.md 2018-03-29 11:17:35 +02:00
Alex Crichton
a0bfb8103b Generate node.js require directives for --nodejs 2018-03-29 01:47:44 -07:00