wasm-bindgen/tests/wasm
Alex Crichton 3f85d7db9f Remove the need for a ConstructorToken
This commit removes the need for an injected `ConstructorToken` type and
also cleans up the story we have for generating constructors a bit.
After this commit a `constructor()` is omitted entirely if we're in
non-debug mode and there's no actual listed constructor. Additionally we
don't deal with splat arguments and rerouting constructors, Nick was
kind enough to enlighten me about `Object.create` which is creating an
instance without running the constructor!

Instances of an exported type are now created through one of two
methods:

* If `#[wasm_bindgen(constructor)]` is present, then a `constructor` is
  generated with the appropriate signature. If a constructor is not
  present and we're in debug mode, a throwing constructor is generated.
  If we're in release mode and there's no constructor, no constructor is
  generated.

* Otherwise if a binding returns an instance of a type (or otherwise
  needs to manfuacture an instance, then it will cause an internal
  `__wrap` function to be generated. This function will use
  `Object.create` to create an instance without running the constructor.

This should ideally clean up our generated JS for classes quite a bit,
making it much more lean-and-mean!
2018-09-21 17:42:06 -07:00
..
api.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
api.rs Add an accessor for wasm's own memory as a JS object 2018-08-27 11:05:55 -07:00
char.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
char.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
classes.js Remove the need for a ConstructorToken 2018-09-21 17:42:06 -07:00
classes.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
closures.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
closures.rs Move the unsize feature behind a nightly Cargo feature 2018-08-19 14:45:59 -07:00
comments.js Move comments test to wasm 2018-08-06 11:46:23 -07:00
comments.rs Move comments test to wasm 2018-08-06 11:46:23 -07:00
duplicate_deps.js Migrate rest of dependencies test to wasm 2018-08-06 10:42:08 -07:00
duplicate_deps.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
duplicates_a.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates_b.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates_c.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates.rs Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
enums.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
enums.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
import_class.js Fix the constructor and catch attributes combined 2018-08-20 10:40:54 -07:00
import_class.rs Fix the constructor and catch attributes combined 2018-08-20 10:40:54 -07:00
imports.js Only generate JS null checks in debug mode 2018-09-21 16:10:02 -07:00
imports.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
js_objects.js Migrate the serde-serialize test to wasm 2018-08-06 09:43:55 -07:00
js_objects.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
jscast.js Implement #[wasm_bindgen(extends = ...)] 2018-08-07 13:04:11 -07:00
jscast.rs Rebase fallout and review comments 2018-08-07 13:24:48 -07:00
main.rs Allow returning Result from functions 2018-09-18 13:13:59 -07:00
math.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
math.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
node.js Move node test over to wasm 2018-08-06 10:06:45 -07:00
node.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
option.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
option.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
optional_primitives.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
optional_primitives.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
rethrow.js Allow returning Result from functions 2018-09-18 13:13:59 -07:00
rethrow.rs Allow returning Result from functions 2018-09-18 13:13:59 -07:00
simple.js Use the JS name of an imported type for instanceof checks 2018-08-08 14:42:21 -07:00
simple.rs Use the JS name of an imported type for instanceof checks 2018-08-08 14:42:21 -07:00
slice.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
slice.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
structural.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
structural.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
u64.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
u64.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
validate_prt.js Only generate JS null checks in debug mode 2018-09-21 16:10:02 -07:00
validate_prt.rs Remove support for the version attribute 2018-08-06 13:30:28 -05:00
variadic.js Add docs and remove typecheck from variadic attribute 2018-09-01 13:55:35 +01:00
variadic.rs Add docs and remove typecheck from variadic attribute 2018-09-01 13:55:35 +01:00