Nick Fitzgerald
4148d3b4ac
macro-support: obey js_class = ...
for constructor methods
...
Fixes #668
2018-08-10 13:36:47 -07:00
Nick Fitzgerald
7af4e62d99
js-sys: Add bindings for Symbol.unscopables
2018-08-10 13:23:17 -07:00
Nick Fitzgerald
016449ab3c
backend: when complaining about setter names, show the name we are complaining about
2018-08-10 13:15:12 -07:00
Nick Fitzgerald
178a5e89df
js-sys: add bindings for regexp.lastIndex
2018-08-10 13:14:54 -07:00
Nick Fitzgerald
dc028d38c8
js-sys: Add bindings to ReferenceError
2018-08-10 13:03:56 -07:00
Nick Fitzgerald
879fd43edb
js-sys: Add bindings to RangeError
2018-08-10 13:03:44 -07:00
Nick Fitzgerald
adad606ee3
js-sys: Add bindings for Object.create
2018-08-10 11:49:22 -07:00
Nick Fitzgerald
4ea1603ddb
js-sys: Add bindings to Object.assign
2018-08-10 11:41:58 -07:00
Nick Fitzgerald
f0444d1614
js-sys: Add bindings for Intl.Collator
2018-08-10 11:20:06 -07:00
Nick Fitzgerald
7f5d0a2158
js-sys: Move Intl
from a type to a module, since it is a namespace
2018-08-10 10:46:53 -07:00
Nick Fitzgerald
a66c4de892
js-sys: remove extra new line
2018-08-10 10:40:43 -07:00
Nick Fitzgerald
e667400a83
js-sys: Remove unused import in symbol tests
2018-08-10 10:29:35 -07:00
Nick Fitzgerald
95c55d0b4c
js-sys: Add bindings to Array.of
2018-08-10 10:29:22 -07:00
Alex Crichton
d390f2fe04
Merge pull request #680 from fitzgen/js-sys-promise-arguments-by-shared-ref
...
Js sys promise arguments by shared ref
2018-08-09 18:52:32 -06:00
Andrew Chin
70406fe18a
Add support and tests for EvalError
2018-08-09 19:26:00 -04:00
Nick Fitzgerald
ff83594882
futures: Add sanity tests for conversion between Promises and Futures
...
Part of #614
2018-08-09 16:21:49 -07:00
Nick Fitzgerald
f9ac4e9c90
Always bind static operations to their class
...
For example, `Promise.resolve` must always be called with the `Promise`
constructor as its `this`, or else it will throw an error.
2018-08-09 16:17:34 -07:00
Nick Fitzgerald
96ad97a9f9
js-sys: Document that new bindings should take JS things by shared ref
2018-08-09 13:08:51 -07:00
Nick Fitzgerald
e3011d629e
js-sys: Promise methods should take JS things by shared reference
2018-08-09 13:08:30 -07:00
Andrew Chin
c371c4a509
Fixup from merge commit
2018-08-09 14:36:37 -04:00
Nick Fitzgerald
f8af399301
Merge branch 'master' into extends_object
2018-08-09 10:57:15 -07:00
Alex Crichton
f85fd0e2ad
Merge pull request #675 from sepiropht/master
...
[670] add extends for Array type
2018-08-09 09:52:13 -05:00
Nick Fitzgerald
bd62fdbd8b
Merge pull request #672 from bokuweb/number-extends-attributes
...
js-sys: Add extends attributes for js_sys::Number
2018-08-09 07:35:35 -07:00
sepiropht
e9e7072687
[670] add extends for Array type
2018-08-09 14:35:44 +02:00
Alex Crichton
157ba00660
Merge pull request #673 from fitzgen/futures-docs
...
wasm-bindgen-futures docs and example usage
2018-08-08 23:23:48 -05:00
Andrew Chin
cc8095d065
Add extends attributes for several types
...
Part of #670
2018-08-08 23:16:57 -04:00
bokuweb
42e02f7769
js-sys: Add extends attributes for js_sys::Number
2018-08-09 10:10:20 +09:00
Alex Crichton
505037ffae
Merge pull request #669 from fitzgen/contributing-testing
...
Contributing testing docs
2018-08-08 19:50:00 -05:00
Nick Fitzgerald
170f20e1fd
futures: Add more documentation and example usage
...
Adds an example future that becomes ready on the next tick of the JavaScript
micro task queue.
Part of #614
2018-08-08 17:44:38 -07:00
Nick Fitzgerald
235f9cc04e
js-sys: Add extends attributes for js_sys::RegExp
...
Part of #670
2018-08-08 16:23:12 -07:00
Nick Fitzgerald
e8a6341d2b
test: Add documentation about configuring headless browser testing
2018-08-08 15:47:46 -07:00
Nick Fitzgerald
66f10b0c72
Merge pull request #666 from fitzgen/instanceof-renamed-import-types
...
Instanceof renamed import types
2018-08-08 15:31:24 -07:00
Nick Fitzgerald
2f455f1f7a
macro-support: Run rustfmt on src/parser.rs
2018-08-08 14:42:53 -07:00
Nick Fitzgerald
998d37a353
Use the JS name of an imported type for instanceof
checks
2018-08-08 14:42:21 -07:00
gnzlbg
153505f6c7
Document workaround for avoiding duplicated symbols when using wasm-bindgen-test from git
2018-08-08 20:28:49 +02:00
Nick Fitzgerald
9104bf87e9
backend: Rename ast::ImportType::name to ast::ImportType::rust_name
...
This helps pave the way for adding a js_name, and makes it more clear which name
this is.
2018-08-07 16:09:38 -07:00
Alex Crichton
37db88ebfa
Implement #[wasm_bindgen(extends = ...)]
...
This commit implements the `extends` attribute for `#[wasm_bindgen]` to
statically draw the inheritance hierarchy in the generated bindings, generating
appropriate `AsRef`, `AsMut`, and `From` implementations.
2018-08-07 13:04:11 -07:00
Alex Crichton
11553a1af2
Implement JsCast
for all imported types
...
This commit implements the `JsCast` trait automatically for all imported types
in `#[wasm_bindgen] extern { ... }` blocks. The main change here was to generate
an `instanceof` shim for all imported types in case it's needed.
All imported types now also implement `AsRef<JsValue>` and `AsMut<JsValue>`
2018-08-07 12:59:51 -07:00
Alex Crichton
f3f11ed8eb
Clean up generated code for imported types
...
Group all the generated impls in a `const` block so we can use `use` without
clashing with the outside scope.
2018-08-07 12:59:51 -07:00
Alex Crichton
0d18c8c397
Fix consuming a struct and returning a slice
...
This came up in a [recent comment][1] and it turns out we're accidentally
generating two `const ptr = ...` declarations, invalid JS! While Node doesn't
catch this it looks like firefox does.
[1]: https://github.com/rustwasm/wasm-bindgen/issues/329#issuecomment-411082013
2018-08-07 08:46:38 -07:00
Alex Crichton
b6a6dee7f1
Merge pull request #652 from afdw/master
...
Add support for getters, setters and deleters
2018-08-06 21:43:53 -05:00
Anton Danilkin
86b5ba6431
Add missing indexing words
2018-08-07 02:45:08 +03:00
Anton Danilkin
d396c168a5
Fix comments in parser
2018-08-07 00:48:03 +03:00
Anton Danilkin
3ad5493d23
Add a test for webidl
2018-08-07 00:42:47 +03:00
Anton Danilkin
e70c9015ff
Rename special to indexing
2018-08-07 00:06:04 +03:00
Anton Danilkin
ef3f086102
Merge remote-tracking branch 'upstream/master'
...
# Conflicts:
# crates/webidl/src/first_pass.rs
# crates/webidl/src/lib.rs
# crates/webidl/src/util.rs
2018-08-06 23:37:12 +03:00
Alex Crichton
b2977a4262
Delete wasm-bindgen-test-project-builder
...
No more tests use it!
2018-08-06 11:48:34 -07:00
Alex Crichton
d5b81595ec
Remove support for the version
attribute
...
First added in #161 this never ended up panning out, so let's remove the
experimental suport which isn't actually used by anything today and hold off on
any other changes until an RFC happens.
2018-08-06 13:30:28 -05:00
Alex Crichton
6edf063c94
Allow disabling --debug
in wasm-bindgen-test-runner
...
Afterwards remove the `non_debug` test as we're running the entire test suite in
non-debug mode!
2018-08-06 09:57:41 -07:00
Camille TJHOA
aeca24c7ab
Add ArrayBuffer.prototype.byteLength
to js-sys
2018-08-06 11:44:24 -05:00