feat: update readme, add regexp test
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user