wasm-bindgen/crates/js-sys/tests/wasm
Alex Crichton 44738e049a Add warnings about UTF-16 vs UTF-8 strings
This commit aims to address #1348 via a number of strategies:

* Documentation is updated to warn about UTF-16 vs UTF-8 problems
  between JS and Rust. Notably documenting that `as_string` and handling
  of arguments is lossy when there are lone surrogates.

* A `JsString::is_valid_utf16` method was added to test whether
  `as_string` is lossless or not.

The intention is that most default behavior of `wasm-bindgen` will
remain, but where necessary bindings will use `JsString` instead of
`str`/`String` and will manually check for `is_valid_utf16` as
necessary. It's also hypothesized that this is relatively rare and not
too performance critical, so an optimized intrinsic for `is_valid_utf16`
is not yet provided.

Closes #1348
2019-04-05 08:11:50 -07:00
..
Array.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
ArrayBuffer.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
ArrayIterator.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Boolean.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
DataView.rs Run rustfmt over everything 2018-11-27 12:07:59 -08:00
Date.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Error.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
EvalError.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Function.js Migrate Function tests to wasm 2018-07-20 12:43:07 -07:00
Function.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Generator.js Port Generator tests to wasm 2018-07-20 12:56:32 -07:00
Generator.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
global_fns.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Intl.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Iterator.js js-sys: Add js_sys::try_iter for iterating over any JsValue 2018-09-25 14:30:26 -07:00
Iterator.rs Run rustfmt over everything 2018-11-27 12:07:59 -08:00
JSON.rs js-sys: JSON::stringify_with_replacer[_and_space] 2019-01-16 18:03:03 -05:00
JsString.js Add bindings for String.prototype.replace 2018-08-19 14:42:22 -04:00
JsString.rs Add warnings about UTF-16 vs UTF-8 strings 2019-04-05 08:11:50 -07:00
main.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Map.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
MapIterator.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Math.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Number.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Object.js Port Object tests to wasm 2018-07-20 15:23:56 -07:00
Object.rs Optimize shim generation for structural items 2018-11-08 13:04:38 -08:00
Promise.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Proxy.js Port Proxy tests to wasm 2018-07-20 15:35:15 -07:00
Proxy.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
RangeError.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
ReferenceError.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Reflect.js js-sys: Catch exceptions thrown in Reflect APIs 2018-09-25 14:30:26 -07:00
Reflect.rs Add experimental support for the anyref type 2019-02-20 07:28:54 -08:00
RegExp.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Set.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
SetIterator.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
Symbol.js Port Symbol and SetIterator tests to wasm 2018-07-20 16:19:10 -07:00
Symbol.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
SyntaxError.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
TypedArray.rs Add conversions between typed arrays and Rust 2019-01-04 10:42:14 -08:00
TypeError.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
UriError.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
WeakMap.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
WeakSet.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
WebAssembly.js js-sys: Add bindings for WebAssembly.instantiateStreaming 2018-09-06 14:47:37 -07:00
WebAssembly.rs Run rustfmt over everything 2018-11-27 12:07:59 -08:00