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

Prototype inheritance #1737

Closed
wants to merge 1 commit into from
Closed
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
25 changes: 20 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-bindgen"
version = "0.2.51"
version = "0.2.52"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand Down Expand Up @@ -36,15 +36,16 @@ strict-macro = ["wasm-bindgen-macro/strict-macro"]
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]

[dependencies]
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.51" }
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.52" }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
cfg-if = "0.1.9"
proc-macro-hack = "0.5"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
js-sys = { path = 'crates/js-sys', version = '0.3.28' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.1' }
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.1' }
js-sys = { path = 'crates/js-sys', version = '0.3.29' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.2' }
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.2' }
serde_derive = "1.0"
wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' }
wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' }
Expand Down Expand Up @@ -79,6 +80,20 @@ members = [
"examples/todomvc",
"examples/wasm-in-wasm",
"examples/wasm2js",
"examples/web-components-composed-composed-path",
"examples/web-components-defined-pseudo-class",
"examples/web-components-edit-word",
"examples/web-components-editable-list",
"examples/web-components-element-details",
"examples/web-components-expanding-list-web-component",
"examples/web-components-host-selectors",
"examples/web-components-life-cycle-callbacks",
"examples/web-components-popup-info-box-external-stylesheet",
"examples/web-components-popup-info-box-web-component",
"examples/web-components-simple-template",
"examples/web-components-slotchange",
"examples/web-components-slotted-pseudo-element",
"examples/web-components-word-count-web-component",
"examples/webaudio",
"examples/webgl",
"examples/websockets",
Expand Down
1 change: 1 addition & 0 deletions _package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"devDependencies": {
"@wasm-tool/wasm-pack-plugin": "1.0.1",
"copy-webpack-plugin": "^5.0.0",
"html-webpack-plugin": "^3.2.0",
"text-encoding": "^0.7.0",
"webpack": "^4.29.4",
Expand Down
2 changes: 1 addition & 1 deletion crates/anyref-xform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-bindgen-anyref-xform"
version = "0.2.51"
version = "0.2.52"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/anyref-xform"
Expand Down
4 changes: 2 additions & 2 deletions crates/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-bindgen-backend"
version = "0.2.51"
version = "0.2.52"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
Expand All @@ -22,4 +22,4 @@ log = "0.4"
proc-macro2 = "1.0"
quote = '1.0'
syn = { version = '1.0', features = ['full'] }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.51" }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.52" }
6 changes: 4 additions & 2 deletions crates/backend/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub struct Export {
pub method_kind: MethodKind,
/// The type of `self` (either `self`, `&self`, or `&mut self`)
pub method_self: Option<MethodSelf>,
/// The body of the method
pub method_body: Option<syn::Block>,
/// The struct name, in Rust, this is attached to
pub rust_class: Option<Ident>,
/// The name of the rust function/method on the rust side.
Expand All @@ -57,8 +59,6 @@ pub struct Export {
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
#[derive(Clone)]
pub enum MethodSelf {
/// `self`
ByValue,
/// `&mut self`
RefMutable,
/// `&self`
Expand Down Expand Up @@ -223,6 +223,8 @@ pub struct Struct {
pub js_name: String,
pub fields: Vec<StructField>,
pub comments: Vec<String>,
pub prototype: syn::Type,
pub prototype_field: Option<syn::Member>,
}

#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
Expand Down
Loading