Commit Graph

86 Commits

Author SHA1 Message Date
ea74b8acba Add bindings for Intl.DateTimeFormat 2018-08-14 07:50:13 +10: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
7f5d0a2158 js-sys: Move Intl from a type to a module, since it is a namespace 2018-08-10 10:46:53 -07:00
a66c4de892 js-sys: remove extra new line 2018-08-10 10:40:43 -07: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
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
70406fe18a Add support and tests for EvalError 2018-08-09 19:26:00 -04:00
96ad97a9f9 js-sys: Document that new bindings should take JS things by shared ref 2018-08-09 13:08:51 -07:00
e3011d629e js-sys: Promise methods should take JS things by shared reference 2018-08-09 13:08:30 -07: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
b2977a4262 Delete wasm-bindgen-test-project-builder
No more tests use it!
2018-08-06 11:48:34 -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
081f2fdc65 Add Function construtor to js-sys 2018-07-30 11:07:07 -07: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
037915827b Fix incorrect url 2018-07-27 10:10:11 +02:00
8ec9713dd9 js-sys: Add some more Cargo.toml metadata like license 2018-07-26 15:06:24 -07:00
6203fc8f98 js-sys: Add a js-sys specific CHANGELOG.md 2018-07-26 15:05:00 -07:00
9a0470b1c4 Bump to 0.2.15 2018-07-26 14:53:59 -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
64591ef403 Js sys use &str arguments (#555)
* js-sys: imports should take &str parameters instead of &JsString

* js-sys: Imports should take Option<&str> instead of Option<String>
2018-07-25 18:50:30 -05:00
61fc8d2567 Js sys once over (#550)
* js-sys: Return `f64` instead of `Number`

* js-sys: remove trailing whitespace

* js-sys: Ensure that all imported types derive Clone and Debug

* js-sys: Imported functions should always take JS object arguments by-ref
2018-07-25 16:33:44 -05:00
3f5a0fb31c Bump to 0.2.14 2018-07-25 09:46:45 -07:00