@@ -16,12 +16,10 @@ pub mod js {
16 pub fn add_change_list_range(&self, _start: usize, _len: usize) {}
16 pub fn add_change_list_range(&self, _start: usize, _len: usize) {}
17 pub fn init_events_trampoline(&self, _trampoline: &crate::EventsTrampoline) {}
17 pub fn init_events_trampoline(&self, _trampoline: &crate::EventsTrampoline) {}
20− pub fn eval_change_list() {}
22 use wasm_bindgen::prelude::*;
20 use wasm_bindgen::prelude::*;
24− #[wasm_bindgen]
22+ #[wasm_bindgen(module = "/js/change-list.js")]
25 extern "C" {
23 extern "C" {
26 #[derive(Clone, Debug)]
24 #[derive(Clone, Debug)]
27 pub type ChangeList;
25 pub type ChangeList;
@@ -44,20 +42,6 @@ pub mod js {
44 trampoline: &crate::EventsTrampoline,
42 trampoline: &crate::EventsTrampoline,
48− pub fn eval_change_list() {
50− // XXX: Because wasm-bindgen-test doesn't support third party JS
51− // dependencies, we can't use `wasm_bindgen(module = "...")` for our
52− // `ChangeList` JS import. Instead, this *should* be a local JS snippet,
53− // but that isn't implemented yet:
54− // https://github.com/rustwasm/rfcs/pull/6
55− static EVAL: Once = Once::new();
57− js_sys::eval(include_str!("../js/change-list.js"))
58− .expect_throw("should eval change-list.js OK");
@@ -94,7 +78,6 @@ impl fmt::Debug for ChangeList {
95impl ChangeList {
79impl ChangeList {
96 pub(crate) fn new(container: &crate::Element) -> ChangeList {
80 pub(crate) fn new(container: &crate::Element) -> ChangeList {
97− js::eval_change_list();
98 let bump = Bump::new();
81 let bump = Bump::new();
99 let strings_cache = FxHashMap::default();
82 let strings_cache = FxHashMap::default();
100 let js = js::ChangeList::new(container);
83 let js = js::ChangeList::new(container);