Commit Graph

407 Commits

Author SHA1 Message Date
21cb50ef05 Merge pull request #412 from matiasinsaurralde/intl
Add bindings for `Intl`
2018-07-09 10:31:22 -07:00
b4c7a5c1e1 Fix some cases with #[deny(missing_docs)]
Generated functions by wasm-bindgen should either be `#[doc(hidden)]` or include
the docs on the original item!

Closes #425
2018-07-09 08:49:16 -07:00
bfec9e6401 bindings for parseInt/parseFloat (#384)
* parseInt, parseFloat, JsValue::is_nan

* Number.parseInt, Number.parseFloat

* remove `JsValue::is_nan`

* parse_int/float returns f64
2018-07-09 08:59:54 -05:00
5bfde7778d binding for Date.prototype.getUTCSeconds() 2018-07-09 18:20:04 +09:00
15d9f743ec binding for Date.prototype.getUTCMonth() 2018-07-09 18:08:38 +09:00
2e85bbd9e0 binding for Date.prototype.getUTCMinutes() 2018-07-09 18:04:20 +09:00
c260ac7c3e binding for Date.prototype.getUTCMilliseconds() 2018-07-09 17:59:15 +09:00
6aa3661e11 binding for Date.prototype.getUTCHours() 2018-07-09 17:54:19 +09:00
975818a1f6 binding for Date.prototype.getUTCFullYear() 2018-07-09 17:50:13 +09:00
ea19848691 binding for Date.prototype.getUTCDay() 2018-07-09 17:46:21 +09:00
792baefc22 binding for Date.prototype.getUTCDate() 2018-07-09 17:42:30 +09:00
d3a17d4014 binding for Date.prototype.getTimezoneOffset() 2018-07-09 17:38:38 +09:00
6758525980 bindings for isFinite(), Number.isFinite() and Number.isSafeInteger() (#420)
* bindings for isFinite()

* bindings for Number.isFiniter(), refactoring of Number.isInteger()

* bindings for Number.isSafeInteger()
2018-07-08 10:03:10 -05:00
791e69a5c0 Generate normal Rust functions for imported bindings (#410)
* Generate normal Rust functions for imported bindings

No need to use the C ABI, it just mixes up the documentation!

* Update expected webidl output
2018-07-07 12:20:42 -05:00
056b45aeed bindings for Date.parse and Date.getXXX (#414)
* binding for Date.prototype.getHours()

* binding for Date.prototype.getMilliseconds()

* binding for Date.prototype.getMinutes()

* binding for Date.prototype.getMonth()

* binding for Date.prototype.getSeconds()

* binding for Date.prototype.getTime()

* binding for Date.parse()
2018-07-07 12:09:46 -05:00
8352b4610f Add bindings for Intl.getCanonicalLocales 2018-07-07 08:00:22 -04:00
ef807a8068 Tweak some docs and fixup some symbol tests 2018-07-06 20:00:53 -07:00
a526be9baf Merge pull request #401 from rail44/support-symbol
Add support for static props of Symbol
2018-07-06 09:15:36 -07:00
83a7d5bfdc Merge pull request #399 from alexcrichton/jsvalue-debug
Implement `Debug for JsValue`
2018-07-06 13:36:17 +02:00
c9f4a266b0 Merge pull request #386 from jannikkeye/bindings-reflect
Reflect.xx bindings
2018-07-06 13:34:59 +02:00
f7dc819289 Merge pull request #387 from Hywan/webassembly
feat(js) Implement the `WebAssembly.validate` binding.
2018-07-06 13:33:37 +02:00
b4bf8fbfba test(js) New WebAssembly.validate_with_invalid_input test case. 2018-07-06 10:41:51 +02:00
d1955c91b7 test(js) Don't unwrap to false. 2018-07-06 10:41:32 +02:00
6e4948d983 Add support for static props of Symbol 2018-07-06 17:07:43 +09:00
2022b44416 fix: convert tests to plain js 2018-07-06 09:41:08 +02:00
99d66ad6ed merge master 2018-07-06 09:31:58 +02:00
a65b6c7003 Merge pull request #397 from ZerothLaw/Issue275/ArrayFind
Issue #275: Added Array.prototype.find binding
2018-07-06 09:22:46 +02:00
142d7377e2 Merge pull request #400 from alexcrichton/derive-import
Forward attributes on `type` declaration to definition
2018-07-06 09:21:01 +02:00
1bcfcaf1ed TypeScript is no longer enabled 2018-07-06 15:41:07 +09:00
bd068207a1 Fix test of Symbol.hasInstance 2018-07-06 14:57:22 +09:00
2518048f25 Add support Symbol.hasInstance as sample of static prop getter 2018-07-06 14:57:17 +09:00
5a776c16b2 Forward attributes on type declaration to definition
This'll allow things like `#[derive(Clone)]` or `#[derive(Debug)]` to control
traits for these types.
2018-07-05 20:28:52 -07:00
d930a5a97a Implement Debug for JsValue 2018-07-05 20:24:28 -07:00
d29b17f158 Issue #275: Added Array.prototype.find binding 2018-07-05 15:05:23 -07:00
bc2eab1434 Merge pull request #396 from fitzgen/pull-project-testing-out-into-its-own-crate
tests: Pull the `project()` builder out into its own crate
2018-07-05 15:01:21 -07:00
549e5a9be9 tests: Pull the project() builder out into its own crate
The WebIDL-based -sys crate will also use this, but I want its tests to be a
separate suite that we can run separately and in parallel in CI. Therefore, this
testing infrastructure code needs to be share-able between them :)
2018-07-05 14:27:26 -07:00
7ff90f1490 js: Return scalar types instead of Number objects
99% of the time we don't want to deal with opaque handles to `Number`
objects.
2018-07-05 13:02:40 -07:00
52a00d5e16 Merge pull request #392 from brisad/add-more-bindings
Add bindings in Date and Number
2018-07-05 19:51:58 +02:00
9f3722bbd9 Change assert to assert.ok to fix test 2018-07-05 17:34:45 +02:00
260183a522 Add binding for Number.isInteger 2018-07-05 17:09:59 +02:00
9d3b26341e Add binding for Date.prototype.getDate 2018-07-05 17:09:59 +02:00
59b3b4dc8d Headless browser testing infrastructure (#371)
* tests: Add newlines between impl methods for Project

* WIP headless browser testing with geckodriver and selenium

* Get some more of headless testing working

* Extract `console.log` invocations and print them from the console
* Ship the error message from an exception from the browser back to the command
  line
* Cleanup some "if headless" and `else` branches
* Fix killing `webpack-dev-server` in the background with `--watch-stdin`

* Fix path appending logic for Windows

* Always log logs/errors in headless mode

* Install Firefox on Travis

* Don't duplicate full test suite with `yarn`

No need to run that many tests, we should be able to get by with a smoke test
that it just works.

* headless tests: Move `run-headless.js` to its own file and `include_str!` it

* Run `rustfmt` on `tests/all/main.rs`

* guide: Add note about headless browser tests and configuration

* test: Log WASM_BINDGEN_FIREFOX_BIN_PATH in run-headless.js

* TEMP only run add_headless test in CI

* Add more logging to headless testing

* Allow headless tests to run for 60 seconds before timeout

* TEMP add logging to add_headless test

* Fix headless browser tests

* Another attempt to fix Travis

* More attempts at debugging

* Fix more merge conflicts

* Touch up an error message

* Fixup travis again

* Enable all travis tests again

* Test everything on AppVeyor
2018-07-05 09:22:01 -05:00
06b8d3535d js_globals::Proxy::*: make tests plain JS
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 09:03:16 +02:00
8dd8475000 fix: Reflec.defineProperty no longer returns Result 2018-07-05 08:33:22 +02:00
b704ceeb3a Bindings for Proxy.revocable()
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 08:04:41 +02:00
2b8e789c9c Bindings for Proxy.new()
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 08:04:41 +02:00
efa4a2b8fa Speed up Travis by running Webpack in fewer tests (#381)
* Reorganize Travis configuration

* Add a `JOB` env var descriptor to all matrix entries. Not used anywhere but is
  useful when viewing the whole build on Travis's web interface.
* Reorganize where builds are located, moving slow builds first and fast ones
  last.
* Change checking the CLI builds from `cargo build` to `cargo check`
* Use YAML references to reduce some duplication

* Print some more timing statistics for each test

* Extract `Project` helper in tests to a module

This'll help make it a bit more extensible over time. At the same time the
methods are also slightly reorganized to read more clearly from top to bottom.

* Migrate all tests away from Webpack

Wepback can take a significant amount of time to execute and when it's
multiplied by hundreds of tests that adds up really quickly! After investigating
Node's `--experimental-modules` option it looks like it's suitable for our use
so this switches all tests to using JS files (moving away from TypeScript as
well) with `--experimental-modules` with Node.

Tests will be selectively re-enabled with webpack and node.js specific output
(that doesn't require `--experimental-modules`), coming in later commits.

* Restore the node test for node.js output

Ensures it's workable as-is

* Only generate typescript with webpack

* Only read wasm files for webpack

* Skip package.json/node_modules for now

* Only generate webpack config if needed

* Start a dedicated test module for typescript

Will hopefully verify the generated Typescript compiles OK.

* Remove unneeded `node` method

* Fixup some rebase conflicts

* Don't run asmjs example on travis

* Fixup generator tests

* Attempt to fix windows

* Comment windows fix

* More test fixes

* More exclusions

* More test fixes

* Relax eslint regex

Catch mjs modules as well

* Fix eslint

* Speed up travis on examples slightly
2018-07-04 22:37:09 -05:00
e912b9d2a2 Merge pull request #374 from Hywan/js_test_date_locale
test(js) Fix expectations regarding given locales
2018-07-04 22:25:05 +02:00
43de00b347 feat(js) Add ArrayBuffer::new, ::is_view & ::slice bindings. (#388)
* feat(js) Add `ArrayBuffer::new`, `::is_view` & `::slice` bindings.

* fix(js) Fix number units, comments, add `slice_with_end`.

* test(js) Fix a function name.
2018-07-04 13:53:49 -05:00
f5d4751c0b test(js) Check the types and lightly the data, but not that much.
Because NodeJS can have different i18n behaviors depending of the
version, let's keep things simple. In this case, we want to test the
types,
period. Cf. https://github.com/rustwasm/wasm-bindgen/pull/374#issuecomment-402447333
2018-07-04 16:47:51 +02:00