feat: update readme, add regexp test

This commit is contained in:
2022-12-31 00:16:59 +08:00
parent a0359637e2
commit 34c04da05d
2 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
Post:
- https://boa-dev.github.io/posts/2022-10-24-boa-usage/
https://boa-dev.github.io/posts/2022-10-24-boa-usage/ Need resolved issue:
- https://github.com/boa-dev/boa/issues/2350

View File

@@ -3,7 +3,7 @@ use boa_engine::property::Attribute;
fn main() { fn main() {
let mut context = Context::default(); let mut context = Context::default();
// context.set_trace(true); context.set_trace(true);
context.register_global_property("MY_PROJECT_VERSION", "1.0.0", Attribute::all()); context.register_global_property("MY_PROJECT_VERSION", "1.0.0", Attribute::all());
context.register_global_function("print", 0, print); context.register_global_function("print", 0, print);
let script = r##" let script = r##"
@@ -14,6 +14,7 @@ fn main() {
helloworld(); helloworld();
for (var i = 0; i < 10; i++) {} for (var i = 0; i < 10; i++) {}
// while(true) {} // while(true) {}
/(a+)+b/.test('a'.repeat(15) + 'c');
"hello world!!!" "hello world!!!"
"##; "##;
match context.eval(script) { match context.eval(script) {