Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gate web-sys APIs on activated features #790

Merged
merged 5 commits into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_script:
- where chromedriver
- set CHROMEDRIVER=C:\Tools\WebDriver\chromedriver.exe
- cargo test -p js-sys --target wasm32-unknown-unknown
- cargo test -p web-sys --target wasm32-unknown-unknown
- cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features
- cargo test -p webidl-tests --target wasm32-unknown-unknown

branches:
Expand Down
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,15 @@ matrix:
- *INSTALL_CHROMEDRIVER
script:
- export RUST_LOG=wasm_bindgen_test_runner
- CHROMEDRIVER=`pwd`/chromedriver cargo test -p web-sys --target wasm32-unknown-unknown
- GECKODRIVER=`pwd`/geckodriver cargo test -p web-sys --target wasm32-unknown-unknown
# Test out builds with just a few features
- cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown
- cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Node
- cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Element
- cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Window

# Now run all the tests with all the features
- CHROMEDRIVER=`pwd`/chromedriver cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features
- GECKODRIVER=`pwd`/geckodriver cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features
addons:
firefox: latest
chrome: stable
Expand Down Expand Up @@ -176,7 +183,10 @@ matrix:
- cargo install-update -a
script:
- (cd guide && mdbook build)
- cargo doc --no-deps -p wasm-bindgen -p web-sys -p js-sys -p wasm-bindgen-futures
- cargo doc --no-deps
- cargo doc --no-deps --manifest-path crates/js-sys/Cargo.toml
- cargo doc --no-deps --manifest-path crates/futures/Cargo.toml
- cargo doc --no-deps --manifest-path crates/web-sys/Cargo.toml --all-features
- mv target/doc guide/book/api
deploy:
provider: pages
Expand Down
9 changes: 9 additions & 0 deletions crates/backend/src/defined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ where
}
}

impl<'a, T: ImportedTypes> ImportedTypes for &'a T {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
(*self).imported_types(f)
}
}

impl ImportedTypes for ast::Program {
fn imported_types<F>(&self, f: &mut F)
where
Expand Down
3 changes: 3 additions & 0 deletions crates/backend/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ macro_rules! bail_span {
)
}

#[derive(Debug)]
pub struct Diagnostic {
inner: Repr,
}

#[derive(Debug)]
enum Repr {
Single {
text: String,
Expand Down
1 change: 1 addition & 0 deletions crates/backend/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ pub fn wrap_import_function(function: ast::ImportFunction) -> ast::Import {
///
/// Hashes the public field here along with a few cargo-set env vars to
/// distinguish between runs of the procedural macro.
#[derive(Debug)]
pub struct ShortHash<T>(pub T);

impl<T: Hash> fmt::Display for ShortHash<T> {
Expand Down
Loading