fn generate_properties(&self) -> (Vec<TokenStream>,Option<ImplItemMethod>) {

        let mut constructor: Option<ImplItemMethod> = None;
        let properties = self.item.items.iter()
            .filter_map(|i_item| {
                match i_item {
                    ImplItem::Method(method) => {
                        if is_js_method(method) {
                            let method_ident = &method.sig.ident;
                           // println!("method: {:#?}",method);
                            let attribute = FunctionTags::parse_attr(method);
                            let property_name = attribute.name().unwrap_or_else(|| Literal::string(&default_function_property_name(&method_ident.to_string())));
                            let napi_name = Ident::new(&format!("napi_{}",method_ident),Span::call_site());
                            if attribute.is_getter() {
                                Some(quote! {
                                    node_bindgen::core::Property::new(#property_name).getter(Self::#napi_name),
                                })
                            } else if attribute.is_setter() {
                                Some(quote! {
                                    node_bindgen::core::Property::new(#property_name).setter(Self::#napi_name),
                                })

                            } else if attribute.is_constructor() {
                                match constructor {
                                    Some(_) => {},
                                    None => {
                                        std::mem::replace(&mut constructor,Some(method.clone()));
                                    }
                                }
                                None
                            } else {                               
                                Some(quote! {
                                    node_bindgen::core::Property::new(#property_name).method(Self::#napi_name),
                                })
                            }
                        } else {
                            None
                        }
                    },
                    _ => None
                }
            })
            .collect();

        (properties,constructor)
    }
/// find methods which are defined in node_bindgen annotation
find methods which are defined in node_bindgen annotation
find methods which are defined in node_bindgen annotation
fn generate_properties(&self) -> (Vec<TokenStream>,Option<ImplItemMethod>) {
        let mut constructor: Option<ImplItemMethod> = None;
        let properties = self.item.items.iter()
            .filter_map(|i_item| {
                match i_item {
                    ImplItem::Method(method) => {
                        if is_js_method(method) {
                            let method_ident = &method.sig.ident;
                           // println!("method: {:#?}",method);
                            let attribute = FunctionTags::parse_attr(method);
                            let property_name = attribute.name().unwrap_or_else(|| Literal::string(&default_function_property_name(&method_ident.to_string())));
                            let napi_name = Ident::new(&format!("napi_{}",method_ident),Span::call_site());
                            if attribute.is_getter() {
                                Some(quote! {
                                    node_bindgen::core::Property::new(#property_name).getter(Self::#napi_name),
                                })
                            } else if attribute.is_setter() {
                                Some(quote! {
                                    node_bindgen::core::Property::new(#property_name).setter(Self::#napi_name),
                                })
                            } else if attribute.is_constructor() {
                                match constructor {
                                    Some(_) => {},
                                    None => {
                                        std::mem::replace(&mut constructor,Some(method.clone()));
                                    }
                                }
                                None
                            } else {                               
                                Some(quote! {
                                    node_bindgen::core::Property::new(#property_name).method(Self::#napi_name),
                                })
                            }
                        } else {
                            None
                        }
                    },
                    _ => None
                }
            })
            .collect();
        (properties,constructor)
    }
fn generate_properties ( & self ) -> ( Vec < TokenStream > , Option < ImplItemMethod > ) { let mut constructor : Option < ImplItemMethod > = None ; let properties = self . item . items . iter ( ) . filter_map ( | i_item | { match i_item { ImplItem :: Method ( method ) => { if is_js_method ( method ) { let method_ident = & method . sig . ident ; // println!("method: {:#?}",method); let attribute = FunctionTags :: parse_attr ( method ) ; let property_name = attribute . name ( ) . unwrap_or_else ( | | Literal :: string ( & default_function_property_name ( & method_ident . to_string ( ) ) ) ) ; let napi_name = Ident :: new ( & format ! ( " " method_ident ) , Span :: call_site ( ) ) ; if attribute . is_getter ( ) { Some ( quote ! { node_bindgen core Property new ( property_name ) getter ( Self napi_name ) } ) } else if attribute . is_setter ( ) { Some ( quote ! { node_bindgen core Property new ( property_name ) setter ( Self napi_name ) } ) } else if attribute . is_constructor ( ) { match constructor { Some ( _ ) => { } , None => { std :: mem :: replace ( & mut constructor , Some ( method . clone ( ) ) ) ; } } None } else { Some ( quote ! { node_bindgen core Property new ( property_name ) method ( Self napi_name ) } ) } } else { None } } , _ => None } } ) . collect ( ) ; ( properties , constructor ) }
find methods which are defined in node_bindgen annotation
find methods which are defined in node_bindgen annotation
&self