1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Bridge between boa-cat (JS engine) and the DOM + fetch.
//!
//! # Example
//!
//! ```
//! # fn main() -> Result<(), web_api_cat::Error> {
//! use boa_cat::{evaluate_program_with, env::Env, fuel::Fuel, heap::Heap};
//! use ecma_lex_cat::lex;
//! use ecma_parse_cat::parse_script;
//!
//! let html = html_cat::parse("<html><body><p id='g'>hi</p></body></html>")?;
//! let (env, heap) = web_api_cat::install(Env::empty(), Heap::new(), &html);
//! let tokens = lex("document.getElementById('g').textContent")
//! .map_err(boa_cat::Error::from)?;
//! let program = parse_script(&tokens).map_err(boa_cat::Error::from)?;
//! let (value, _heap) = evaluate_program_with(&program, env, heap, Fuel::new(100_000))?;
//! assert_eq!(format!("{value}"), "\"hi\"");
//! # Ok(())
//! # }
//! ```
pub use ;
pub use Error;
pub use extract_document;
pub use install;