mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-20 16:26:33 +00:00
Move some utility functions from the webidl crate into the backend crate
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
use proc_macro2::{Ident, Span, TokenStream, TokenTree};
|
||||
use quote::ToTokens;
|
||||
use shared;
|
||||
use std::iter::FromIterator;
|
||||
use syn;
|
||||
use util;
|
||||
|
||||
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
|
||||
#[derive(Default)]
|
||||
@ -416,20 +416,7 @@ impl Program {
|
||||
} else if let Some(cls) = wasm.opts.static_method_of() {
|
||||
let class = cls.to_string();
|
||||
let kind = MethodKind::Static;
|
||||
|
||||
let segments = syn::punctuated::Punctuated::from_iter(Some(syn::PathSegment {
|
||||
ident: cls.clone(),
|
||||
arguments: syn::PathArguments::None,
|
||||
}));
|
||||
|
||||
let ty = syn::Type::Path(syn::TypePath {
|
||||
qself: None,
|
||||
path: syn::Path {
|
||||
leading_colon: None,
|
||||
segments,
|
||||
},
|
||||
});
|
||||
|
||||
let ty = util::ident_ty(cls.clone());
|
||||
ImportFunctionKind::Method { class, ty, kind }
|
||||
} else if wasm.opts.constructor() {
|
||||
let class = match wasm.ret {
|
||||
|
Reference in New Issue
Block a user