Commit Graph

1404 Commits

Author SHA1 Message Date
156eb24359 Use raw string in paths in webidl-tests generated code
This fixes things on Windows, which uses backslashes in their paths
2018-08-14 19:11:58 -04:00
ca5e7b8542 Fix for some unused import warnings 2018-08-14 19:11:38 -04:00
da95415bec Merge pull request #697 from thomaseizinger/bindings/remaining-intl-bindings
Add remaining bindings for the Intl namespace
2018-08-14 15:54:18 -07:00
f5ab32a8bc Translate WebIDL promise type to js_sys::Promise
This does involve us losing the type argument present in the WebIDL, but for now
that should be fine as we're exposing low-level bindings and it's not otherwise
clear whether having a typed wrapper is a great option. Usage of `JsCast` can
convert the incoming value to a different object fairly easily.

The purpose of the `web-sys` crate is to expose functionality of the web, not
necessarily take an opinionated stance on how it should be exposed. In that
sense it should be able to work with the `Promise` as you would a typed promise
in terms of no functionality is left out. That being said we'll likely want to
be sure to reconsider this before 1.0-stabilizing the `web-sys` crate!
2018-08-14 15:52:52 -07:00
79f9d966e5 Merge pull request #698 from alexcrichton/const-mixins
Generate const mixin bindings
2018-08-14 11:27:33 -07:00
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
5ab54a4094 Remove warning, was fixed with the 0.2.16 release 2018-08-14 10:02:30 +02:00
dce4a88f7d Generate const mixin bindings
Whenever an interface includes a mixin which includes consts, inline the consts
onto the interface.
2018-08-13 21:58:40 -07:00
44f2ac0e9f Add bindings for Intl.NumberFormat and Intl.PluralRules 2018-08-14 13:46:06 +10:00
ade4a2c97a Fix typo in Intl.DateTimeFormat documentation 2018-08-14 13:45:49 +10:00
03eb1b1d01 Support named "special" operations in WebIDL
This commit adds support for two different features of the "special" operations
in WebIDL. First, it implements the desugaring [described by WebIDL][1] where
this:

    interface Dictionary {
      getter double getProperty(DOMString propertyName);
      setter void setProperty(DOMString propertyName, double propertyValue);
    };

becomes ...

    interface Dictionary {
      double getProperty(DOMString propertyName);
      void setProperty(DOMString propertyName, double propertyValue);

      getter double (DOMString propertyName);
      setter void (DOMString propertyName, double propertyValue);
    };

where specifically a named `getter` generates both a getter and a named
function.

Second it implements the distinction between two different types of getters in
WebIDL, described as:

> Getters and setters come in two varieties: ones that take a DOMString as a
> property name, known as named property getters and named property setters, and
> ones that take an unsigned long as a property index, known as indexed property
> getters and indexed property setters.

The name `get` is given to DOMString arguments, and the name `get_idx` is given
to index property getters.

[1]: https://heycam.github.io/webidl/#idl-special-operations
2018-08-13 17:52:34 -07: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
f4012defac futures: Add metadata to Cargo.toml 2018-08-13 14:35:35 -07:00
a434880229 Bump js-sys to 0.2.1 2018-08-13 14:32:52 -07:00
8974a57fb9 Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
ea27a172d9 Merge pull request #692 from quelledanielle/js_string_bindings
Add bindings for static method String.from_char_code
2018-08-13 14:27:00 -07:00
30fc99b724 Use u32 params for String.from_char_code bindings 2018-08-13 17:03:58 -04:00
c666f752fa Add OptionalAndUnionArguments test 2018-08-13 23:18:16 +03:00
7840367476 Fix console test 2018-08-13 20:09:18 +03:00
f35296f8ac Merge branch 'master' of https://github.com/rustwasm/wasm-bindgen 2018-08-13 18:59:52 +03:00
fd5958b51b Add bindings for String.from_char_code 2018-08-13 00:19:43 -04:00
aa735d221a Use js_class for static method bindings as well 2018-08-12 23:16:18 -04:00
36fe4c23dc Merge pull request #678 from derekdreery/webidl_namespace_support
Add support webidl namespaces.
2018-08-12 17:41:54 -07:00
4f0ddd25ce Fix tests 2018-08-12 21:27:27 +01:00
23009dbc1e Add simple test for namespaces. 2018-08-12 21:11:02 +01:00
833099dd0d Fix error 2018-08-12 13:11:53 +01:00
e66d4da835 Fix some of @ohanar issues 2018-08-12 12:11:09 +01:00
e92374a8c8 Migrate to IdlType 2018-08-11 23:46:33 +03:00
eaacdc8966 Mark that link is checked; 2018-08-11 12:57:45 +01:00
df1342398d Add support for partial namespaces 2018-08-11 12:50:18 +01:00
a23fa03ad0 Closer to finished
- Tried `cargo doc` and seen methods generated.
 - Added test with a few method calls to the console operations.
2018-08-11 12:38:58 +01: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
4148d3b4ac macro-support: obey js_class = ... for constructor methods
Fixes #668
2018-08-10 13:36:47 -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
016449ab3c backend: when complaining about setter names, show the name we are complaining about 2018-08-10 13:15:12 -07:00
178a5e89df js-sys: add bindings for regexp.lastIndex 2018-08-10 13:14:54 -07:00