Boa: Boa prelude (A convenience module that re-exports the most commonly-used Boa APIs)

Created on 1 Jun 2020  路  1Comment  路  Source: boa-dev/boa

What would the prelude contain?

Maybe Interpreter, Value, what else?

How to use (just an example)

use boa::prelude::*; // This would import all the commonly-used things

fn main() {
    let number = Value::number(3.1415);

    let realm = Realm::create();
    let mut engine = Interpreter::new(realm);
    let result = forward(&mut engine, "Math.PI");
}
enhancement discussion API

Most helpful comment

Would be useful for tests, so we could start with that as a use case.

>All comments

Would be useful for tests, so we could start with that as a use case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasonwilliams picture jasonwilliams  路  24Comments

raskad picture raskad  路  11Comments

evomassiny picture evomassiny  路  12Comments

jasonwilliams picture jasonwilliams  路  20Comments

Razican picture Razican  路  11Comments