Commit Graph

181 Commits

Author SHA1 Message Date
d9fbc48daa js-sys: Add extends attributes for js_sys::Float32Array 2018-08-14 19:38:33 +02:00
10bc69a8cd js-sys: Add extends attributes for js_sys::Int32Array 2018-08-14 19:34:59 +02:00
2d737c5634 js-sys: Add extends attributes for js_sys::Int16Array 2018-08-14 19:34:43 +02:00
17ef5f9702 js-sys: Add extends attributes for js_sys::Int8Array 2018-08-14 19:34:26 +02:00
b80090d395 js-sys: Add extends attributes for js_sys::UInt32Array 2018-08-14 19:32:34 +02:00
e58e231fdf js-sys: Add extends attributes for js_sys::UInt16Array 2018-08-14 19:32:14 +02:00
2979618842 js-sys: Add extends attributes for js_sys::UInt8ClampedArray 2018-08-14 19:31:49 +02:00
ea0ac134db js-sys: Add extends attributes for js_sys::Uint8Array 2018-08-14 19:29:13 +02:00
44f2ac0e9f Add bindings for Intl.NumberFormat and Intl.PluralRules 2018-08-14 13:46:06 +10:00
c0c27775f3 Merge pull request #681 from sepiropht/master
[670] add extends for some types
2018-08-13 18:39:53 -06:00
595162b35d Merge pull request #691 from thomaseizinger/bindings/intl-datetimeformat
Add bindings for Intl.DateTimeFormat
2018-08-13 18:23:57 -06:00
96c24c47a2 add extends for JsString 2018-08-14 00:47:36 +02:00
ea74b8acba Add bindings for Intl.DateTimeFormat 2018-08-14 07:50:13 +10:00
30fc99b724 Use u32 params for String.from_char_code bindings 2018-08-13 17:03:58 -04:00
fd5958b51b Add bindings for String.from_char_code 2018-08-13 00:19:43 -04:00
539e987cdb Merge pull request #685 from fitzgen/a-few-more-js-sys-things
A few more js sys things
2018-08-11 07:52:26 +02:00
36e15149c7 js-sys: Add bindings for TypeError 2018-08-10 13:45:39 -07:00
38ef5f9ffe js-sys: Add bindings for SyntaxError 2018-08-10 13:42:13 -07:00
a58c2584b3 js-sys: Add bindings to URIError 2018-08-10 13:37:34 -07:00
2a3d01c380 Merge pull request #683 from eminence/json
Add initial support and tests for JSON
2018-08-10 13:27:40 -07:00
7af4e62d99 js-sys: Add bindings for Symbol.unscopables 2018-08-10 13:23:17 -07:00
178a5e89df js-sys: add bindings for regexp.lastIndex 2018-08-10 13:14:54 -07:00
dc028d38c8 js-sys: Add bindings to ReferenceError 2018-08-10 13:03:56 -07:00
879fd43edb js-sys: Add bindings to RangeError 2018-08-10 13:03:44 -07:00
adad606ee3 js-sys: Add bindings for Object.create 2018-08-10 11:49:22 -07:00
4ea1603ddb js-sys: Add bindings to Object.assign 2018-08-10 11:41:58 -07:00
1092816652 Use Reflect::set instead of javascript helper 2018-08-10 14:33:21 -04:00
f0444d1614 js-sys: Add bindings for Intl.Collator 2018-08-10 11:20:06 -07:00
f5203bba8a Handle exceptions from JSON::stringify 2018-08-10 14:13:57 -04:00
e667400a83 js-sys: Remove unused import in symbol tests 2018-08-10 10:29:35 -07:00
95c55d0b4c js-sys: Add bindings to Array.of 2018-08-10 10:29:22 -07:00
23cb0ea656 Add initial support and tests for JSON 2018-08-09 20:54:13 -04:00
70406fe18a Add support and tests for EvalError 2018-08-09 19:26:00 -04:00
c371c4a509 Fixup from merge commit 2018-08-09 14:36:37 -04:00
f8af399301 Merge branch 'master' into extends_object 2018-08-09 10:57:15 -07:00
f85fd0e2ad Merge pull request #675 from sepiropht/master
[670] add extends for Array type
2018-08-09 09:52:13 -05:00
e9e7072687 [670] add extends for Array type 2018-08-09 14:35:44 +02:00
cc8095d065 Add extends attributes for several types
Part of #670
2018-08-08 23:16:57 -04:00
42e02f7769 js-sys: Add extends attributes for js_sys::Number 2018-08-09 10:10:20 +09:00
235f9cc04e js-sys: Add extends attributes for js_sys::RegExp
Part of #670
2018-08-08 16:23:12 -07:00
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
aeca24c7ab Add ArrayBuffer.prototype.byteLength to js-sys 2018-08-06 11:44:24 -05:00
73e89fc59b Add bindings for RegExp.$1-$9 2018-08-06 10:41:06 -05:00
eee71de0ce Support asynchronous tests (#600)
* Tweak the implementation of heap closures

This commit updates the implementation of the `Closure` type to internally store
an `Rc` and be suitable for dropping a `Closure` during the execution of the
closure. This is currently needed for promises but may be generally useful as
well!

* Support asynchronous tests

This commit adds support for executing tests asynchronously. This is modeled
by tests returning a `Future` instead of simply executing inline, and is
signified with `#[wasm_bindgen_test(async)]`.

Support for this is added through a new `wasm-bindgen-futures` crate which is a
binding between the `futures` crate and JS `Promise` objects.

Lots more details can be found in the details of the commit, but one of the end
results is that the `web-sys` tests are now entirely contained in the same test
suite and don't need `npm install` to be run to execute them!

* Review tweaks

* Add some bindings for `Function.call` to `js_sys`

Name them `call0`, `call1`, `call2`, ... for the number of arguments being
passed.

* Use oneshots channels with `JsFuture`

It did indeed clean up the implementation!
2018-08-01 15:52:24 -05:00
7b4f0072c8 Add support for headless testing
This commit adds support to the `wasm-bindgen-test-runner` binary to
perform headless testing via browsers. The previous commit introduced a
local server to serve up files and run tests in a browser, and this
commit adds support for executing that in an automated fashion.

The general idea here is that each browser has a binary that implements
the WebDriver specification. These binaries (typically `foodriver` for
the browser "Foo") are interfaced with using HTTP and JSON messages. The
implementation was simple enough and the crates.io support was lacking
enough that a small implementation of the WebDriver protocol was added
directly to this crate.

Currently Firefox (`geckodriver`), Chrome (`chromedriver`), and Safari
(`safaridriver`) are supported for running tests. The test harness will
recognize env vars like `GECKODRIVER=foo` to specifically use one or
otherwise detects the first driver in `PATH`. Eventually we may wish to
automatically download a driver if one isn't found, but that isn't
implemented yet.

Headless testing is turned on with the `CI=1` env var currently to be
amenable with things like Travis and AppVeyor, but this may wish to grow
an explicit option to run headless tests in the future.
2018-07-30 11:07:07 -07:00
f5f541337c Create bindings for RegExp (#580)
* Create bindings for RegExp

* Address review comments

- Split the constructor into two: `new` and `new_regexp`. This way we
  can write RegExp::new("foo", "g") rather than
  RegExp::new(&JsValue::from("foo"), "g").

- The js_name for the setter for lastIndex should be `lastIndex` and
  not `set_lastIndex`. But fixing this causes a panic. Remove the
  method for now.
2018-07-29 16:13:42 -07:00
01194558bf Adds Array.prototype.splice() to js-sys (#571) 2018-07-27 10:07:21 -07:00
a204c8d4b7 Merge pull request #565 from fitzgen/js-sys-iterator-protocol
js-sys: Unify all iterators under one generic iterator type
2018-07-26 14:22:34 -07:00
62de3bad67 js-sys: Unify all iterators under one generic iterator type
The JS iterator protocol uses duck typing and we don't need separate
ArrayIterator and SetIterator etc types, we can have a single iterator type for
the whole protocol.
2018-07-26 13:48:52 -07:00
41200743af Tweak js-sys tests to pass in Firefox
Turns out date parsing is slightly different there!
2018-07-25 16:55:11 -07:00