Closer to finished

- Tried `cargo doc` and seen methods generated.
 - Added test with a few method calls to the console operations.
This commit is contained in:
Richard Dodd 2018-08-11 12:38:58 +01:00
parent 0d897e9b8d
commit a23fa03ad0
3 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,9 @@
use wasm_bindgen_test::*;
use wasm_bindgen::prelude::*;
use web_sys::console;
#[wasm_bindgen_test]
fn test_console() {
console::time("test label");
console::time_end("test label");
}

View File

@ -14,6 +14,7 @@ pub mod anchor_element;
pub mod body_element; pub mod body_element;
pub mod br_element; pub mod br_element;
pub mod button_element; pub mod button_element;
pub mod console;
pub mod div_element; pub mod div_element;
pub mod element; pub mod element;
pub mod event; pub mod event;

View File

@ -36,7 +36,7 @@ use std::path::Path;
use backend::TryToTokens; use backend::TryToTokens;
use backend::defined::{ImportedTypeDefinitions, RemoveUndefinedImports}; use backend::defined::{ImportedTypeDefinitions, RemoveUndefinedImports};
use backend::util::{ident_ty, rust_ident, wrap_import_function}; use backend::util::{ident_ty, rust_ident, raw_ident, wrap_import_function};
use failure::ResultExt; use failure::ResultExt;
use heck::{ShoutySnakeCase, SnakeCase}; use heck::{ShoutySnakeCase, SnakeCase};
use proc_macro2::{Ident, Span}; use proc_macro2::{Ident, Span};
@ -892,7 +892,7 @@ impl<'src> WebidlParse<'src, NamespaceNames<'src>> for weedle::namespace::Operat
let import = backend::ast::Import { let import = backend::ast::Import {
module: None, module: None,
js_namespace: Some(ns_names.js_name.clone()), js_namespace: Some(raw_ident(ns_names.js_name)),
kind: backend::ast::ImportKind::Function(imported_fn), kind: backend::ast::ImportKind::Function(imported_fn),
}; };