Commit Graph

533 Commits

Author SHA1 Message Date
R. Andrew Ohana
16cbca74e2 deal with yet another locale/platform issue (#480)
This test fails on my system. As previously decided, until we can
figure out a better solution for this issue, for now we just check
to make sure the output is a non-empty string.
2018-07-14 22:45:49 -05:00
Tomohide Takao
7a7bc6d22e Bindings for Array.prototype.toLocaleString() 2018-07-14 19:45:22 +09:00
Tomohide Takao
f5035c3841 Bindings for Array.prototype.findIndex() 2018-07-14 19:33:48 +09:00
Tomohide Takao
a7deb69e80 Bindings for Array.prototype.reduce(Right) 2018-07-12 23:53:26 +09:00
Liigo Zhuang
e666371ae3 some fix 2018-07-12 10:11:44 +08:00
Liigo Zhuang
823e5a4fd9 fix test 2018-07-12 09:55:34 +08:00
Liigo Zhuang
79f53b567b js::DataView binding 2018-07-12 09:55:33 +08:00
T. Nagasawa
5ce424e57b bindings for Date.prototype.setUTCXXX() (#456) 2018-07-11 09:27:59 -05:00
Tomohide Takao
d7857da262 binding for Array.prototype.map() 2018-07-11 07:20:52 +09:00
Nick Fitzgerald
92dd8e859f Move webidl tests to the webidl crate's test suite (#451)
* webidl: Remove exact-output tests

These have not been as effective, nor as easy to write and maintain, as the
project()-based integration tests.

* tests: Move webidl tests into the webidl crate's test suite
2018-07-10 16:17:33 -05:00
Nick Fitzgerald
42938792c7
Merge pull request #430 from FreeMasen/js_docs
Js docs
2018-07-10 10:08:41 -07:00
Nick Fitzgerald
7200d36fb6
Merge pull request #438 from toVersus/js_date
bindings for Date.setXXX
2018-07-10 10:04:36 -07:00
Satoshi Amemiya
8be0a98386 Add support for methods of Symbol (#437) 2018-07-10 09:46:05 -05:00
toversus
d2feddcf90 fix to have no impact on timezones difference 2018-07-10 23:31:25 +09:00
Robert Masen
c7d98b9ee1 add js doc @param and @returns annotations 2018-07-10 08:42:34 -05:00
toversus
91d6ae5f04 binding for Date.prototype.setTime() 2018-07-10 21:46:44 +09:00
toversus
c185897eff binding for Date.prototype.setSeconds() 2018-07-10 21:45:33 +09:00
toversus
609d457301 binding for Date.prototype.setMonth() 2018-07-10 21:27:12 +09:00
toversus
a81827caf9 binding for Date.prototype.setMinutes() 2018-07-10 21:20:18 +09:00
toversus
11a58a1bd0 binding for Date.prototype.setMilliseconds() 2018-07-10 20:55:45 +09:00
toversus
524628e1e1 binding for Date.prototype.setHours() 2018-07-10 20:51:39 +09:00
toversus
d555b7f068 binding for Date.prototype.setFullYear() 2018-07-10 20:45:25 +09:00
toversus
1a8da45340 binding for Date.prototype.setDate() 2018-07-10 20:38:54 +09:00
Nick Fitzgerald
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
Nick Fitzgerald
2b5dd430a8
Merge pull request #428 from alexcrichton/missing-docs
Fix some cases with `#[deny(missing_docs)]`
2018-07-09 11:01:05 -07:00
Michael Hoffmann
bae324c951 Add Array.prototype.values binding (#395) 2018-07-09 12:42:30 -05:00
Nick Fitzgerald
21cb50ef05
Merge pull request #412 from matiasinsaurralde/intl
Add bindings for `Intl`
2018-07-09 10:31:22 -07:00
Alex Crichton
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
Liigo Zhuang
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
toversus
5bfde7778d binding for Date.prototype.getUTCSeconds() 2018-07-09 18:20:04 +09:00
toversus
15d9f743ec binding for Date.prototype.getUTCMonth() 2018-07-09 18:08:38 +09:00
toversus
2e85bbd9e0 binding for Date.prototype.getUTCMinutes() 2018-07-09 18:04:20 +09:00
toversus
c260ac7c3e binding for Date.prototype.getUTCMilliseconds() 2018-07-09 17:59:15 +09:00
toversus
6aa3661e11 binding for Date.prototype.getUTCHours() 2018-07-09 17:54:19 +09:00
toversus
975818a1f6 binding for Date.prototype.getUTCFullYear() 2018-07-09 17:50:13 +09:00
toversus
ea19848691 binding for Date.prototype.getUTCDay() 2018-07-09 17:46:21 +09:00
toversus
792baefc22 binding for Date.prototype.getUTCDate() 2018-07-09 17:42:30 +09:00
toversus
d3a17d4014 binding for Date.prototype.getTimezoneOffset() 2018-07-09 17:38:38 +09:00
Alexander Kryvomaz
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
Alex Crichton
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
T. Nagasawa
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
Matias Insaurralde
8352b4610f
Add bindings for Intl.getCanonicalLocales 2018-07-07 08:00:22 -04:00
Alex Crichton
ef807a8068 Tweak some docs and fixup some symbol tests 2018-07-06 20:00:53 -07:00
Nick Fitzgerald
a526be9baf
Merge pull request #401 from rail44/support-symbol
Add support for static props of Symbol
2018-07-06 09:15:36 -07:00
Marcin Baraniecki
83a7d5bfdc
Merge pull request #399 from alexcrichton/jsvalue-debug
Implement `Debug for JsValue`
2018-07-06 13:36:17 +02:00
Marcin Baraniecki
c9f4a266b0
Merge pull request #386 from jannikkeye/bindings-reflect
Reflect.xx bindings
2018-07-06 13:34:59 +02:00
Marcin Baraniecki
f7dc819289
Merge pull request #387 from Hywan/webassembly
feat(js) Implement the `WebAssembly.validate` binding.
2018-07-06 13:33:37 +02:00
Ivan Enderlin
b4bf8fbfba
test(js) New WebAssembly.validate_with_invalid_input test case. 2018-07-06 10:41:51 +02:00
Ivan Enderlin
d1955c91b7
test(js) Don't unwrap to false. 2018-07-06 10:41:32 +02:00
Satoshi Amemiya
6e4948d983 Add support for static props of Symbol 2018-07-06 17:07:43 +09:00
Jannik Keye
2022b44416 fix: convert tests to plain js 2018-07-06 09:41:08 +02:00
Jannik Keye
99d66ad6ed merge master 2018-07-06 09:31:58 +02:00
Sendil Kumar N
a65b6c7003
Merge pull request #397 from ZerothLaw/Issue275/ArrayFind
Issue #275: Added Array.prototype.find binding
2018-07-06 09:22:46 +02:00
Sendil Kumar N
142d7377e2
Merge pull request #400 from alexcrichton/derive-import
Forward attributes on `type` declaration to definition
2018-07-06 09:21:01 +02:00
Satoshi Amemiya
1bcfcaf1ed TypeScript is no longer enabled 2018-07-06 15:41:07 +09:00
Satoshi Amemiya
bd068207a1 Fix test of Symbol.hasInstance 2018-07-06 14:57:22 +09:00
Satoshi Amemiya
2518048f25 Add support Symbol.hasInstance as sample of static prop getter 2018-07-06 14:57:17 +09:00
Alex Crichton
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
Alex Crichton
d930a5a97a Implement Debug for JsValue 2018-07-05 20:24:28 -07:00
Tyler Laing
d29b17f158 Issue #275: Added Array.prototype.find binding 2018-07-05 15:05:23 -07:00
Nick Fitzgerald
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
Nick Fitzgerald
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
Nick Fitzgerald
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
Sendil Kumar N
52a00d5e16
Merge pull request #392 from brisad/add-more-bindings
Add bindings in Date and Number
2018-07-05 19:51:58 +02:00
Michael Hoffmann
9f3722bbd9 Change assert to assert.ok to fix test 2018-07-05 17:34:45 +02:00
Michael Hoffmann
260183a522 Add binding for Number.isInteger 2018-07-05 17:09:59 +02:00
Michael Hoffmann
9d3b26341e Add binding for Date.prototype.getDate 2018-07-05 17:09:59 +02:00
Nick Fitzgerald
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
Stephan Renatus
06b8d3535d js_globals::Proxy::*: make tests plain JS
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 09:03:16 +02:00
Jannik Keye
8dd8475000 fix: Reflec.defineProperty no longer returns Result 2018-07-05 08:33:22 +02:00
Stephan Renatus
b704ceeb3a Bindings for Proxy.revocable()
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 08:04:41 +02:00
Stephan Renatus
2b8e789c9c Bindings for Proxy.new()
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 08:04:41 +02:00
Alex Crichton
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
Sendil Kumar N
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
Ivan Enderlin
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
Ivan Enderlin
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
Jannik Keye
7790b34c07 fix: simplify signatures to avoid Result usage 2018-07-04 16:10:17 +02:00
Jannik Keye
40b7b069bc fix: return actual error message 2018-07-04 15:52:12 +02:00
Ivan Enderlin
c450fbf237
feat(js) Support exception on WebAssembly::validate. 2018-07-04 15:51:55 +02:00
Jannik Keye
008f17143b fix: Reflect.has target should be &Object 2018-07-04 15:32:34 +02:00
Ivan Enderlin
fe25a9a268
feat(js) Implement the WebAssembly.validate binding. 2018-07-04 15:27:01 +02:00
Marcin Baraniecki
2694dd4dee
Merge pull request #385 from toVersus/js_date
bindings for date.getDay/getFullYear
2018-07-04 14:56:22 +02:00
Jannik Keye
1397f9b05a feat: add Reflect.setPrototypeOf 2018-07-04 13:13:35 +02:00
Jannik Keye
eb3f67a36f feat: add Reflect.set 2018-07-04 13:08:43 +02:00
Jannik Keye
fc82ba4ec3 feat: add Reflect.preventExtensions 2018-07-04 12:56:37 +02:00
Jannik Keye
e36f982391 feat: add Reflect.ownKeys 2018-07-04 12:53:38 +02:00
toversus
e95994fd19 bindings for Date.prototype.getFullYear() 2018-07-04 19:52:12 +09:00
Jannik Keye
eb245d5503 feat: add Reflect.isExtensible 2018-07-04 12:49:07 +02:00
Jannik Keye
7c297ccfb4 feat: add Reflect.has 2018-07-04 12:44:49 +02:00
toversus
3007e813ea bindings for Date.prototype.getDay() 2018-07-04 19:41:06 +09:00
Jannik Keye
edddd4b08e feat: add Reflect.getPrototypeOf 2018-07-04 12:39:56 +02:00
Jannik Keye
2422c5e945 feat: add Reflect.getOwnPropertyDescriptor 2018-07-04 12:35:40 +02:00
Jannik Keye
3ba00bc13c feat: add Reflect.get 2018-07-04 12:31:24 +02:00
Jannik Keye
5fa18f8f40 feat: add Reflect.deleteProperty 2018-07-04 12:24:52 +02:00
Jannik Keye
07a726b9dc feat: add Reflect.defineProperty 2018-07-04 12:17:01 +02:00
Jannik Keye
13b3b0d87a feat: add Reflect.construct 2018-07-04 12:07:02 +02:00
Jannik Keye
592d426e4f feat: add Reflect.apply 2018-07-04 11:43:34 +02:00
Nick Fitzgerald
fbbd97bbe0
Merge pull request #380 from akryvomaz/master
bindings for Generator.next(), Generator.return() and Generator.throw()
2018-07-03 16:30:46 -07:00
Alexander Kryvomaz
eac2b05b1b added catch attribute to the Generator methods, consistent rust keyword name 2018-07-04 01:22:56 +03:00
Nick Fitzgerald
e644ee6dad
Merge pull request #375 from sendilkumarn/fix-node-webpack
fix webpack to handle node global functions
2018-07-03 13:50:39 -07:00
Alexander Kryvomaz
b797bbc39c bindings for Generator.throw() 2018-07-03 23:48:54 +03:00
Alexander Kryvomaz
39d79eb037 bindings for Generator.return() 2018-07-03 23:47:10 +03:00
Alexander Kryvomaz
6e95ba20f1 bindings for Generator.next() 2018-07-03 23:42:49 +03:00
Jonathan Sundqvist
17fde01243
Merge pull request #378 from jhenninger/math-bindings
Bindings for Math.pow, round, sign, sin, sinh, sqrt, tan, tanh and trunc
2018-07-03 21:08:28 +02:00
Sendil Kumar
f5075eb3be use simplified logic 2018-07-03 20:48:31 +02:00
Sendil Kumar
99ca230bdb add some comments 2018-07-03 20:44:34 +02:00
Johannes Henninger
b689a78351 Bindings for Math.pow, round, sign, sin, sinh, sqrt, tan, tanh and trunc 2018-07-03 20:00:56 +02:00
Sendil Kumar
8f034bc078 fix webpack to handle node global functions 2018-07-03 18:14:30 +02:00
Ivan Enderlin
54523d82ed
test(js) Fix expectations regarding given locales. 2018-07-03 14:37:38 +02:00
Ivan Enderlin
df5fec22d9
fix(js) Use f64 instead of Number. 2018-07-03 14:26:00 +02:00
Ivan Enderlin
fe4c150431
Merge branch 'master' into js_date 2018-07-03 14:12:05 +02:00
Johannes Henninger
6dede6f20f Use f64 for most Math.* bindings (#369) 2018-07-02 23:41:57 -05:00
Alex Crichton
4ceaf3e0f4
Some small cleanups (#366)
* No need for version deps in dev-deps

These are all internal so we can drop the version

* Remove wasm-bindgen-cli's parity-wasm dep

No longer needed

* Tweak file hierarchy in webidl tests

Use Cargo's conventions to avoid the need to define `[[test]]` sections

* Remove unused imports
2018-07-02 11:57:39 -05:00
Marcin Baraniecki
dcb3415da8 Expose bindings/object is* methods (#363)
* implements Object.isExtensible() binding

* implements Object.isFrozen() binding

* implements Object.isSealed() binding
2018-07-02 10:32:16 -05:00
Marcin Baraniecki
37fc159061 implements Object.preventExtensions() binding (#364) 2018-07-02 10:31:40 -05:00
Sendil Kumar N
10ffe8b3be
Merge pull request #361 from brisad/string-lower-and-upper-case
Bindings for string lower and upper case
2018-07-02 09:26:47 +02:00
belfz
1d04203e89 implements Object.values() binding 2018-07-01 23:50:10 +02:00
Michael Hoffmann
d5d451b94b Add binding for String.prototype.toUpperCase 2018-07-01 23:12:42 +02:00
Michael Hoffmann
58560f1408 Add binding for String.prototype.toLowerCase 2018-07-01 23:11:13 +02:00
Jonathan Sundqvist
bfffd58683
Merge pull request #359 from akryvomaz/master
bindings for Function.prototype.bind, decodeURIComponent, encodeURIComponent
2018-07-01 16:55:18 +02:00
Alexander Kryvomaz
609bf34d60 bindings for encodeURIComponent 2018-07-01 15:59:12 +03:00
Alexander Kryvomaz
0f07dd9048 bindings for decodeURIComponent 2018-07-01 15:53:44 +03:00
Alexander Kryvomaz
f850a6fafc bindings for Function.prototype.bind() 2018-07-01 15:44:36 +03:00
belfz
ce9b95635d implements Object.setPrototypeOf() binding 2018-07-01 11:52:22 +02:00
Alex Crichton
cf08aee341 Tidy up a test 2018-06-30 11:19:27 -07:00
Alex Crichton
e06255fba5 Don't generate JS bindings for unused imports
If a JS import's shim isn't actually imported that means that somewhere along
the way it was optimized out or it was never used in the first place! In that
case we can skip generation of the JS bindings for it as it's not needed.
2018-06-29 15:56:12 -07:00
Satoshi Amemiya
f9c804db20 Add support for js::Error 2018-06-29 23:24:46 +09:00
Alex Crichton
e55af85edc
Support by-value self methods (#348)
Refactor slightly to use the same internal support that the other reference
conversions are using.

Closes #329
2018-06-28 20:09:11 -05:00
Alex Crichton
9a3ff77ea9
Support returning custom types in imports (#350)
Closes #320
2018-06-28 20:08:02 -05:00
Alex Crichton
4138583dff
Support wildcard arguments in foreign functions (#351)
No real reason to not support them!

Closes #346
2018-06-28 20:06:35 -05:00
Nick Fitzgerald
37293ee42a
Merge pull request #344 from autodidaddict/math-externs
Binding for Math.cos,cosh,exp,expml,fround,imul,log,log10,log1p,log2
2018-06-28 15:52:45 -07:00
Nick Fitzgerald
5ff6329d29
Merge pull request #349 from jannikkeye/bindings-map
Add bindings for Map.xx
2018-06-28 15:46:07 -07:00
Nick Fitzgerald
e31da84bce
Merge pull request #340 from ohanar/rustfmt
Use rustfmt for standarized formatting
2018-06-28 15:17:23 -07:00
Jannik Keye
d868ff26ef Add bindings for Set.xx (#347)
* feat(Set): add Set.add

* feat(Set): add Set.clear

* feat(Set): add Set.delete

* feat(Set): add Set.has

* feat(Set): add Set.new

* feat(Set): add Set.size

* feat(Set/SetIterator): add Set.entries

* feat(Set/SetIterator): add Set.keys

* feat(Set/SetIterator): add Set.values
2018-06-28 15:57:49 -05:00
Chris Kolodin
9193218648 add bindings for array.prototype.some() (#341)
following the example set in https://github.com/rustwasm/wasm-bindgen/pull/314
2018-06-28 15:57:01 -05:00
Jannik Keye
e0a70417ce feat(Map/MapIterator): add Map.values 2018-06-28 22:00:02 +02:00
Jannik Keye
fc131ee97e feat(Map/MapIterator): add Map.keys 2018-06-28 21:59:11 +02:00
Jannik Keye
228abaa4ae feat(Map/MapIterator): add Map.entries 2018-06-28 21:58:34 +02:00
Jannik Keye
ea19775639 feat(Map): add Map.size 2018-06-28 21:56:49 +02:00
Jannik Keye
6f90bd677b feat(Map): add Map.set 2018-06-28 21:55:55 +02:00
Jannik Keye
27ee57175a feat(Map): add Map.new 2018-06-28 21:55:10 +02:00
Jannik Keye
07e61e1175 feat(Map): add Map.has 2018-06-28 21:54:10 +02:00
Jannik Keye
e0b399643a feat(Map): add Map.get 2018-06-28 21:53:20 +02:00
Jannik Keye
f7e4019e72 feat(Map): add Map.delete 2018-06-28 21:52:27 +02:00
Jannik Keye
ab0546963b feat(Map): add Map.clear 2018-06-28 21:51:39 +02:00
Kevin Hoffman
81e68517f2 Adding line separator in code docs above MDN URLs. 2018-06-28 15:05:10 -04:00
Kevin Hoffman
3e84b97de2 Binding for Math.cos,cosh,exp,expml,fround,imul,log,log10,log1p,log2 2018-06-28 12:46:53 -04:00
R. Andrew Ohana
9127a0419f rustfmt all the things 2018-06-27 22:42:34 -07:00
Nick Fitzgerald
40722b7ae3
Merge pull request #333 from Hywan/js_boolean
feat(js) Implement `Boolean` bindings.
2018-06-27 14:36:00 -07:00
Nick Fitzgerald
5aa648a2e8
Merge pull request #335 from xeqlol/weakset-bindings
Implement Weakset bindings
2018-06-27 14:27:48 -07:00
Nick Fitzgerald
e40a359278
Merge pull request #336 from belfz/expose-bindings/array-prototype-every
implements Array.prototype.every()
2018-06-27 09:11:21 -07:00
Nick Fitzgerald
4ba61c1c20
Merge pull request #332 from Hywan/js_test
test(js) Fix file permissions, and update a comment
2018-06-27 09:08:26 -07:00
belfz
dacf406dbd implements Array.prototype.every() 2018-06-27 13:45:47 +02:00
Dimitrii Nemkov
761a9272ca Added WeakSet delete method 2018-06-27 13:44:01 +05:00
Dimitrii Nemkov
6b798a3508 Added WeakSet add method 2018-06-27 13:38:33 +05:00
Dimitrii Nemkov
846e5aaacc Added WeakSet has method 2018-06-27 13:26:53 +05:00
Dimitrii Nemkov
a0dda505d9 Added WeakSet constructor 2018-06-27 13:15:47 +05:00
Ivan Enderlin
a4d47afda6
feat(js) Implement the Date.UTC binding. 2018-06-27 09:41:16 +02:00
Ivan Enderlin
e334c0c5af
feat(js) Implement the Date.now binding. 2018-06-27 09:40:40 +02:00
Ivan Enderlin
869d99b870
feat(js) Implement Number.new binding. 2018-06-27 09:36:37 +02:00
Ivan Enderlin
91bc7a199c
feat(js) Implement Boolean bindings.
Cf https://github.com/rustwasm/wasm-bindgen/issues/275.
2018-06-27 09:07:47 +02:00
Ivan Enderlin
c99c0f8483
test(js) Fix file permissions, and update a comment. 2018-06-27 08:33:37 +02:00
gaurikholkar
073cf7455b binding for Math.floor 2018-06-27 10:44:43 +05:30
Nick Fitzgerald
c16b9a903c
Merge pull request #330 from elpiel/string-prototypes
String - length, trim, trimLeft, trimRight, trimStart, trimEnd, valueOf, toString
2018-06-26 17:10:15 -07:00
Lachezar Lechev
16517fadcb String - toString and valueOf 2018-06-26 22:21:51 +02:00
Lachezar Lechev
9f087241a1 String - length, trim, trimStart & trimLeft, trimEnd & trimRight 2018-06-26 22:10:25 +02:00
Nick Fitzgerald
919c2bedac
Merge pull request #318 from xeqlol/weakmap-bindings
WeakMap bindings
2018-06-26 12:55:30 -07:00
Nick Fitzgerald
f0614e92e8
Merge pull request #328 from akryvomaz/master
bindings for Function.apply() and Function.toString()
2018-06-26 12:54:10 -07:00
Dimitrii Nemkov
ec8ed3a48d Fixed missed error in WeakMap::set 2018-06-27 00:20:36 +05:00
Dimitrii Nemkov
a6c7b4b69f Changed keys' type JsValue -> Object, changed description of WeakMap constructor 2018-06-26 23:50:31 +05:00
Alexander Kryvomaz
48061aaab6 bindings for Function.prototype.apply() and Function.prototype.toString() 2018-06-26 21:35:28 +03:00
Dimitrii Nemkov
a6d62c696f Merge branch 'master' into weakmap-bindings 2018-06-26 23:29:48 +05:00
Herman J. Radtke III
3833c94400
js: Implement bindings for Array.isArray 2018-06-26 11:11:02 -07:00
Nick Fitzgerald
16bc3eb7e7
Merge pull request #315 from ohanar/yarn2
use both npm and yarn in ci
2018-06-26 10:43:12 -07:00
Nick Fitzgerald
df5862bd7e
Merge branch 'master' into string-code_point_at 2018-06-26 10:39:26 -07:00
Nick Fitzgerald
ff80029cf0
Merge branch 'master' into string-concat 2018-06-26 10:32:42 -07:00
Nick Fitzgerald
6dcbc4a0cc
Merge branch 'master' into date 2018-06-26 10:25:26 -07:00
Nick Fitzgerald
e8c6c40f10
Merge pull request #323 from rail44/string-char_code_at
Support String.prototype.charCodeAt
2018-06-26 10:23:10 -07:00
Nick Fitzgerald
c836639229
Merge pull request #322 from belfz/expose-bindings/object-seal
implements Object.seal() binding
2018-06-26 10:22:00 -07:00
Nick Fitzgerald
552f3c7c66 Merge branch 'string-includes' of https://github.com/rail44/wasm-bindgen into string-includes 2018-06-26 10:17:26 -07:00
Satoshi Amemiya
3d72a90481 Support String.prototype.concat 2018-06-27 00:48:09 +09:00
Sendil Kumar
ef27cb6392 Add date constructor 2018-06-26 16:55:40 +02:00
Sendil Kumar
f9ae7f49ad Add date to date string
fix failing test case
2018-06-26 16:55:40 +02:00
Sendil Kumar
dd3e8cc8b8 Add date to iso string 2018-06-26 16:55:40 +02:00
Sendil Kumar
8f21393c6b Add date to json 2018-06-26 16:55:40 +02:00
Sendil Kumar
be44ad8ad8 Add date to locale date string 2018-06-26 16:55:40 +02:00
Sendil Kumar
4e05bc470f Add date to locale string 2018-06-26 16:55:40 +02:00
Sendil Kumar
c0aba821d5 Add date to locale time string 2018-06-26 16:55:40 +02:00
Sendil Kumar
ca17ef8d7c Add date to string 2018-06-26 16:55:40 +02:00
Sendil Kumar
f30de17c2b Add date to time string 2018-06-26 16:55:39 +02:00
Sendil Kumar
033ba3f3a7 Add date to utc string 2018-06-26 16:55:39 +02:00
Sendil Kumar
cd189d53c4 Add date value of 2018-06-26 16:55:36 +02:00
Satoshi Amemiya
22fdcf02b2 Support String.prototype.charCodeAt 2018-06-26 22:09:43 +09:00
Satoshi Amemiya
efeefbd4c1 Support String.prototype.codePointAt 2018-06-26 22:07:34 +09:00
Satoshi Amemiya
ae847861e7 String - includes() support 2018-06-26 21:10:19 +09:00
belfz
a30509d142 implements Object.seal binding 2018-06-26 14:02:42 +02:00
xeqlol
a369f7a246 WeakMap bindings 2018-06-26 13:12:32 +05:00
Tim Ryan
5925871a05 Adds support for the UInt8Array constructor and its fill method. 2018-06-26 00:34:17 -04:00
R. Andrew Ohana
cc1db03e5a use both npm and yarn in ci 2018-06-25 17:22:51 -07:00
Nick Fitzgerald
0851025ca5 js: Implement bindings for Array.prototype.filter 2018-06-25 16:19:07 -07:00