Commit Graph

221 Commits

Author SHA1 Message Date
5ce424e57b bindings for Date.prototype.setUTCXXX() (#456) 2018-07-11 09:27:59 -05:00
d7857da262 binding for Array.prototype.map() 2018-07-11 07:20:52 +09:00
7200d36fb6 Merge pull request #438 from toVersus/js_date
bindings for Date.setXXX
2018-07-10 10:04:36 -07:00
8be0a98386 Add support for methods of Symbol (#437) 2018-07-10 09:46:05 -05:00
91d6ae5f04 binding for Date.prototype.setTime() 2018-07-10 21:46:44 +09:00
c185897eff binding for Date.prototype.setSeconds() 2018-07-10 21:45:33 +09:00
609d457301 binding for Date.prototype.setMonth() 2018-07-10 21:27:12 +09:00
a81827caf9 binding for Date.prototype.setMinutes() 2018-07-10 21:20:18 +09:00
11a58a1bd0 binding for Date.prototype.setMilliseconds() 2018-07-10 20:55:45 +09:00
524628e1e1 binding for Date.prototype.setHours() 2018-07-10 20:51:39 +09:00
d555b7f068 binding for Date.prototype.setFullYear() 2018-07-10 20:45:25 +09:00
1a8da45340 binding for Date.prototype.setDate() 2018-07-10 20:38:54 +09:00
ae9c5a8d71 [doc] fix ArrayBuffer::is_view()'s document. 2018-07-10 14:07:38 +08:00
f2f2d7231a Create the web-sys crate mechanically from WebIDL (#409)
* Create a new `web-sys` crate

This will eventually contain all the WebIDL-generated bindings to Web APIs.

* ci: Test the new `web-sys` crate in CI

* web-sys: Add a small README

* web-sys: Vendor all the WebIDL files from mozilla-central

* backend: Add a pass to remove AST items that use undefined imports

This is necessary for the WebIDL frontend, which can't translate many WebIDL
constructs into equivalent wasm-bindgen AST things yet. It lets us make
incremental progress: we can generate bindings to methods we can support right
now even though there might be methods on the same interface that we can't
support yet.

* webidl: Add a bunch of missing semicolons

* webidl: Make parsing private

It was only `pub` so that we could test it, but we ended up moving towards
integration tests rather than unit tests that assert particular ASTs are parsed
from WebIDL files.

* webidl: Remove uses of undefined import types

* test-project-builder: Build projects in "very verbose" mode

This helps for debugging failing WebIDL-related tests.

* test-project-builder: Add more profiling timers

* test-project-builder: Detect when webpack-dev-server fails

Instead of going into an infinite loop, detect when webpack-dev-server fails to
start up and early exit the test.

* webidl: Specify version for dev-dependency on wasm-bindgen-backend

Instead of only a relative path.

* guide: Add section about contributing to `web-sys`

* WIP enable Event.webidl

Still need to fix and finish the test.

* Update expected webidl output

* Start out a test's status as incomplete

That way if we don't fill it in the error message doesn't look quite so bizarre

* Fix onerror function in headless mode

Otherwise we don't see any output!

* Fix package.json/node_modules handling in project generation

Make sure these are looked up in the git project root rather than the crate root

* Avoid logging body text

This was meant for debugging and is otherwise pretty noisy

* Fix a relative path

* More expected test fixes

* Fix a typo

* test-project-builder: Allow asynchronous tests

* webidl: Convert [Unforgeable] attributes into `#[wasm_bindgen(structural)]`

Fixes #432

* test-project-builder: Print generated WebIDL bindings for debugging purposes

Helps debug bad WebIDL bindings generation inside tests.

* When we can't find a descriptor, say which one can't be found

This helps when debugging things that need to become structural.

* web-sys: Test bindings for Event

* ci: Use `--manifest-path dir` instead of `cd dir && ...`

* web-sys: Just move .webidl files isntead of symlinking to enable them

* tests: Polyfill Array.prototype.values for older browsers in CI

* test-project-builder: Don't panic on poisoned headless test mutex

We only use it to serialize headless tests so that we don't try to bind the port
concurrently. Its OK to run another headless test if an earlier one panicked.

* JsValue: Add {is,as}_{object,function} methods

Allows dynamically casting values to `js::Object` and `js::Function`.

* tidy: Fix whitespace and missing semicolons

* Allow for dynamic feature detection of methods

If we create bindings to a method that doesn't exist in this implementation,
then it shouldn't fail until if/when we actually try and invoke that missing
method.

* tests: Do feature detection in Array.prototype.values test

* Add JsValue::{is_string, as_js_string} methods

And document all the cast/convert/check methods for js value.

* eslint: allow backtick string literals

* Only generate a fallback import function for non-structural imports
2018-07-09 16:35:25 -07:00
bae324c951 Add Array.prototype.values binding (#395) 2018-07-09 12:42:30 -05:00
21cb50ef05 Merge pull request #412 from matiasinsaurralde/intl
Add bindings for `Intl`
2018-07-09 10:31:22 -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
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
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
6e4948d983 Add support for static props of Symbol 2018-07-06 17:07:43 +09: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
2518048f25 Add support Symbol.hasInstance as sample of static prop getter 2018-07-06 14:57:17 +09:00
baf76431bc Issue #275: Adding Array.prototype.find. Fixing newline. 2018-07-05 16:02:51 -07:00
d29b17f158 Issue #275: Added Array.prototype.find binding 2018-07-05 15:05:23 -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
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
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
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
7790b34c07 fix: simplify signatures to avoid Result usage 2018-07-04 16:10:17 +02:00
c450fbf237 feat(js) Support exception on WebAssembly::validate. 2018-07-04 15:51:55 +02:00
008f17143b fix: Reflect.has target should be &Object 2018-07-04 15:32:34 +02:00
fe25a9a268 feat(js) Implement the WebAssembly.validate binding. 2018-07-04 15:27:01 +02:00