Ingvar Stepanyan
716ed0d891
Hotfix for double encodeInto call
...
This was a regression introduced in the last commit of https://github.com/rustwasm/wasm-bindgen/pull/1470 , which might make Unicode strings 2x slower to pass.
2019-05-14 14:14:34 +01:00
Alex Crichton
15defcfd3a
Add a debug assert and more tests
2019-05-13 08:12:32 -07:00
Ingvar Stepanyan
0c681ee2ba
Fix offset to arg comparison
2019-05-10 15:31:59 +01:00
Ingvar Stepanyan
7418cec613
Reduce reallocation sizes
2019-05-10 14:44:49 +01:00
Ingvar Stepanyan
57b1a57c5e
Speed up passing ASCII-only strings to WASM
...
Some speed up numbers from my string-heavy WASM benchmarks:
- Firefox + encodeInto: +45%
- Chrome + encodeInto: +80%
- Firefox + encode: +29%
- Chrome + encode: +62%
Note that this helps specifically with case of lots of small ASCII strings, in case of large strings there is no measurable difference in either direction.
2019-05-10 14:40:59 +01:00
Nick Fitzgerald
befefe0da6
Merge pull request #1521 from fitzgen/anyref-heap-live-count
...
Utility for counting the number of live JsValues in the wasm-bindgen heap
2019-05-09 16:22:06 -07:00
Nick Fitzgerald
450c9234ad
Add the anyref_heap_live_count
function
...
This is useful for debugging and writing tests that assert various operations do
not leak `JsValue`s.
2019-05-09 15:57:21 -07:00
Chris Trevino
9b5de9f88d
update init test
2019-05-09 11:12:45 -07:00
Chris Trevino
2850cfc78e
update init function export
2019-05-09 11:01:45 -07:00
Alex Crichton
d139228a34
Merge pull request #1508 from RSSchermer/master
...
Add `bufferSubData` and `clearBuffer[fiuv]` to immutable slice whitelist
2019-05-08 07:14:27 -07:00
Alex Crichton
a85335dee9
Merge pull request #1507 from Pauan/futures-0.3
...
Adding in Futures 0.3 support to wasm-bindgen-futures
2019-05-06 10:23:30 -05:00
Pauan
c00262f210
Fixing some nits
2019-05-04 09:28:54 +02:00
Pauan
6c58afda01
Addressing feedback
2019-05-04 09:17:29 +02:00
Alex Crichton
9d33dd8717
Remove unused statements in web-sys build script
2019-05-03 14:59:35 -07:00
Alex Crichton
d6a6fdfcc7
Don't assert rustfmt succeeds
...
Not all environments have it so only run it and hope it succeeds.
2019-05-03 14:59:01 -07:00
Alex Crichton
a7b85362ce
Merge pull request #1506 from alexcrichton/fix-same-name
...
Fix importing and exporting the same name
2019-05-03 11:29:44 -05:00
Alex Crichton
3d43d6e5e8
Fix importing and exporting the same name
...
Run exports through the same identifier generation as imports to ensure
that everything gets a unique identifier and then just make sure all the
appropriate wires are hooked up when dealing with exports and imports.
Closes #1496
2019-05-03 07:15:20 -07:00
Alex Crichton
5a017c1e22
Update walrus
dependency
2019-05-03 07:12:28 -07:00
RSSchermer
15e5162275
Add bufferData
and clearBuffer
to immutable slice whitelist
2019-05-02 18:19:31 +02:00
Pauan
69d7dc24b1
Adding in Futures 0.3 support
2019-05-02 13:48:44 +02:00
Alex Crichton
358ee18ab2
Merge pull request #1466 from fitzgen/log-stacks
...
Log stacks of imported JS functions that throw but aren't marked `catch`
2019-05-01 16:51:50 -05:00
Alex Crichton
22eb34d9ab
Fix direct imports in --target web
...
Currently the import object constructed for the `--target web` output
only ever includes the current module as an one of the modules included.
With `wasm-bindgen`'s optimization to import directly from modules,
however, it's possible to have more modules imported from in the
generated wasm file. This commit ensures that the imports are hooked up
in the `--target web` es6 emulation mode, ensuring there aren't
extraneous errors about import objects.
2019-05-01 13:53:59 -07:00
Alex Crichton
578d59ebc0
Merge pull request #1440 from c410-f3r/getters
...
Getters/Setters for fields
2019-04-30 12:07:34 -05:00
Caio
470eea9fb0
Getters/Setters for fields
2019-04-30 10:26:03 -03:00
Alex Crichton
f2429be07f
Bump to 0.2.43
2019-04-29 08:28:41 -07:00
Alex Crichton
60bb68649b
Merge pull request #1490 from RReverser/deprecate-custom-try-from
...
Recommend to use dyn_ref on funcs and strings
2019-04-29 09:08:00 -05:00
Caio
0c4cdefd07
Rustfmt
2019-04-29 09:45:23 -03:00
Alex Crichton
36c0a1347d
Merge pull request #1492 from RReverser/function-new-with-args
...
Add bindings for `new Function(args, body)`
2019-04-26 12:05:46 -05:00
Ingvar Stepanyan
814f576b1d
Add bindings for new Function(args, body)
...
We don't support variadic args in front, but, luckily for us, `new Function` accepts comma-separated args as a single string as well (see updated JSON test for an example).
2019-04-26 17:42:23 +01:00
Ingvar Stepanyan
85eea18658
Adds missing variadic bindings for string methods
...
- `JsString::from_code_point` - allows to create JS strings using slice of codes in WASM memory.
- `JsString::from_char_code` - same as above, but also uses updated signature with `u16` instead of `u32` (partially helps with #1460 at least for the new binding).
2019-04-26 16:57:34 +01:00
Ingvar Stepanyan
ccc99cd047
Recommend to use dyn_ref on funcs and strings
...
Now that functions and strings work properly with custom typechecks, these custom methods seem obsolete, so I'd recommend to use standard dyn_ref instead.
2019-04-26 15:50:08 +01:00
Alex Crichton
26f9d86f62
Merge pull request #1487 from ibaryshnikov/shared_array_buffer_tests
...
Added tests for SharedArrayBuffer
2019-04-26 09:38:16 -05:00
Alex Crichton
cd7aa717c5
Merge pull request #1467 from RReverser/tuple-structs
...
Generate bindings for indexed struct properties
2019-04-26 09:21:36 -05:00
Kevin Gibbons
70480ad29d
fix test
2019-04-25 21:21:17 -07:00
Kevin Gibbons
a32d2553fc
js-sys: add Object.fromEntries
2019-04-25 20:52:29 -07:00
Alex Crichton
26df24ae6a
Merge pull request #1484 from alexcrichton/new-node
...
Upgrade version of node.js used on Azure
2019-04-25 22:14:31 -05:00
ibaryshnikov
af22a26880
added tests for SharedArrayBuffer
2019-04-26 10:59:06 +08:00
Alex Crichton
7e512ba187
Merge pull request #1463 from ibaryshnikov/atomics-support
...
added Atomics and SharedArrayBuffer
2019-04-25 21:48:55 -05:00
Alex Crichton
4156a37856
Merge pull request #1485 from alexcrichton/missing-vector-len
...
Add missing `expose_wasm_vector_len`
2019-04-25 21:48:09 -05:00
Alex Crichton
dea5bad698
Fix test for node 12
2019-04-25 19:30:32 -07:00
Alex Crichton
21205eccf2
Add missing expose_wasm_vector_len
...
Found through some testing I did awhile back!
2019-04-25 19:21:13 -07:00
ibaryshnikov
b05ae44a8c
changed f64 to i32 in static methods of Atomics, changed static_method_of to js_namespace, set typed_array type to Int32Array in notify and wait methods
2019-04-26 01:56:58 +08:00
ibaryshnikov
58245b0587
changed String to JsString in Atomics::wait
2019-04-26 00:02:19 +08:00
ibaryshnikov
de2c2cf26c
fixed Atomics::wait and Atomics::wait_with_timeout return type
2019-04-25 19:18:31 +08:00
Ingvar Stepanyan
680a6bbb0c
Remove PartialEq<char> for JsString for now
...
This seems to spark controversy, so removing for now but should be easy enough to still add in the future.
2019-04-24 13:40:18 +01:00
ibaryshnikov
0759bfa7e2
f32 changed to f64 in Atomics
2019-04-24 00:27:15 +08:00
ibaryshnikov
f1eaefdf0d
fixed value types in Atomics methods
2019-04-24 00:25:25 +08:00
ibaryshnikov
1071457c3d
added SharedArrayBuffer and Atomics to js-sys
2019-04-24 00:01:15 +08:00
Ingvar Stepanyan
bc4a98d146
Add JsString <-> char conversions
...
These are pretty common and already supported via ABI conversions, yet pretty easy to get wrong when converting them manually.
Fixes #1363 .
2019-04-23 15:54:06 +01:00
Laurențiu Nicola
04a78badc5
Implement Debug for JsFuture
2019-04-20 09:41:59 +03:00