Skip to content

Commit

Permalink
Mass rename anyref to externref
Browse files Browse the repository at this point in the history
Updates a mess of dependencies and tracks the most recent version of the
reference types specification.
  • Loading branch information
alexcrichton committed May 18, 2020
1 parent 61e8fc0 commit 3441822
Show file tree
Hide file tree
Showing 65 changed files with 604 additions and 596 deletions.
28 changes: 15 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ jobs:
displayName: "Futures test suite on wasm"
- script: cargo test -p wasm-bindgen-multi-value-xform
displayName: "multi-value xform tests on native"
- script: |
set -e
echo "##vso[task.setvariable variable=NODE_ARGS]--experimental-wasm-anyref"
echo "##vso[task.setvariable variable=WASM_BINDGEN_ANYREF]1"
displayName: "Configure anyref passes"
- script: cargo test --target wasm32-unknown-unknown --test wasm
displayName: "(anyref) Crate test suite"
- script: WASM_BINDGEN_NO_DEBUG=1 cargo test --target wasm32-unknown-unknown --test wasm
displayName: "(anyref) Crate test suite (no debug)"
- script: cargo test --target wasm32-unknown-unknown --features serde-serialize --test wasm
displayName: "(anyref) Crate test suite (with serde)"
# TODO: re-enable when binary decoding for reference types is updated in
# Node.
# - script: |
# set -e
# echo "##vso[task.setvariable variable=NODE_ARGS]--experimental-wasm-anyref"
# echo "##vso[task.setvariable variable=WASM_BINDGEN_ANYREF]1"
# displayName: "Configure anyref passes"
# - script: cargo test --target wasm32-unknown-unknown --test wasm
# displayName: "(anyref) Crate test suite"
# - script: WASM_BINDGEN_NO_DEBUG=1 cargo test --target wasm32-unknown-unknown --test wasm
# displayName: "(anyref) Crate test suite (no debug)"
# - script: cargo test --target wasm32-unknown-unknown --features serde-serialize --test wasm
# displayName: "(anyref) Crate test suite (with serde)"

- job: test_wasm_bindgen_windows
displayName: "Run wasm-bindgen crate tests (Windows)"
Expand Down Expand Up @@ -91,8 +93,8 @@ jobs:
displayName: "wasm-bindgen-cli-support tests"
- script: cargo test -p wasm-bindgen-cli
displayName: "wasm-bindgen-cli tests"
- script: cargo test -p wasm-bindgen-anyref-xform
displayName: "wasm-bindgen-anyref-xform tests"
- script: cargo test -p wasm-bindgen-externref-xform
displayName: "wasm-bindgen-externref-xform tests"
- script: cargo test -p wasm-bindgen-multi-value-xform
displayName: "wasm-bindgen-multi-value-xform tests"
- script: cargo test -p wasm-bindgen-wasm-interpreter
Expand Down
2 changes: 1 addition & 1 deletion crates/backend/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ impl ToTokens for ast::ImportType {
let typescript_type_chars = typescript_type.chars().map(|c| c as u32);
quote! {
use wasm_bindgen::describe::*;
inform(NAMED_ANYREF);
inform(NAMED_EXTERNREF);
inform(#typescript_type_len);
#(inform(#typescript_type_chars);)*
}
Expand Down
10 changes: 5 additions & 5 deletions crates/cli-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ log = "0.4"
rustc-demangle = "0.1.13"
serde_json = "1.0"
tempfile = "3.0"
walrus = "0.16.1"
wasm-bindgen-anyref-xform = { path = '../anyref-xform', version = '=0.2.62' }
walrus = "0.17.0"
wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.62' }
wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.62' }
wasm-bindgen-shared = { path = "../shared", version = '=0.2.62' }
wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.62' }
wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.62' }
wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.62' }
wit-text = "0.6.0"
wit-walrus = "0.2.0"
wit-validator = "0.1.0"
wit-text = "0.7.0"
wit-walrus = "0.4.0"
wit-validator = "0.2.0"
22 changes: 11 additions & 11 deletions crates/cli-support/src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ tys! {
REFMUT
SLICE
VECTOR
ANYREF
NAMED_ANYREF
EXTERNREF
NAMED_EXTERNREF
ENUM
RUST_STRUCT
CHAR
Expand Down Expand Up @@ -62,8 +62,8 @@ pub enum Descriptor {
Vector(Box<Descriptor>),
CachedString,
String,
Anyref,
NamedAnyref(String),
Externref,
NamedExternref(String),
Enum { hole: u32 },
RustStruct(String),
Char,
Expand Down Expand Up @@ -100,7 +100,7 @@ pub enum VectorKind {
F32,
F64,
String,
Anyref,
Externref,
}

impl Descriptor {
Expand Down Expand Up @@ -133,15 +133,15 @@ impl Descriptor {
OPTIONAL => Descriptor::Option(Box::new(Descriptor::_decode(data, clamped))),
CACHED_STRING => Descriptor::CachedString,
STRING => Descriptor::String,
ANYREF => Descriptor::Anyref,
EXTERNREF => Descriptor::Externref,
ENUM => Descriptor::Enum { hole: get(data) },
RUST_STRUCT => {
let name = get_string(data);
Descriptor::RustStruct(name)
}
NAMED_ANYREF => {
NAMED_EXTERNREF => {
let name = get_string(data);
Descriptor::NamedAnyref(name)
Descriptor::NamedExternref(name)
}
CHAR => Descriptor::Char,
UNIT => Descriptor::Unit,
Expand Down Expand Up @@ -192,7 +192,7 @@ impl Descriptor {
Descriptor::U64 => Some(VectorKind::U64),
Descriptor::F32 => Some(VectorKind::F32),
Descriptor::F64 => Some(VectorKind::F64),
Descriptor::Anyref => Some(VectorKind::Anyref),
Descriptor::Externref => Some(VectorKind::Externref),
_ => None,
}
}
Expand Down Expand Up @@ -254,7 +254,7 @@ impl VectorKind {
VectorKind::U64 => "BigUint64Array",
VectorKind::F32 => "Float32Array",
VectorKind::F64 => "Float64Array",
VectorKind::Anyref => "any[]",
VectorKind::Externref => "any[]",
}
}

Expand All @@ -272,7 +272,7 @@ impl VectorKind {
VectorKind::U64 => 8,
VectorKind::F32 => 4,
VectorKind::F64 => 8,
VectorKind::Anyref => 4,
VectorKind::Externref => 4,
}
}
}
Loading

0 comments on commit 3441822

Please sign in to comment.