-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test cases of QuickJS execution failed #65
Comments
qjs.cpp is actually a very simplified version of qjs.c from quickjs repo. For example, it always evaluates scripts in 'module' mode. diff --git a/qjs.cpp b/qjs.cpp
index 70e215c..6004c25 100644
--- a/qjs.cpp
+++ b/qjs.cpp
@@ -31,7 +31,7 @@ int main(int argc, char ** argv)
try
{
if(argv[1])
- context.evalFile(argv[1], JS_EVAL_TYPE_MODULE);
+ context.evalFile(argv[1], 0);
}
catch(exception & e)
{ |
Other js scripts would execute failed with
./qjs ~/wslumi.gateway.mgl03/quickjs/tests/microbench.js ./qjs ~/wslumi.gateway.mgl03/quickjs/tests/test_std.js ./qjs ~/wslumi.gateway.mgl03/quickjs/tests/test_bignum.js ./qjs ~/wslumi.gateway.mgl03/quickjs/tests/test_worker.js ./qjs ~/wslumi.gateway.mgl03/quickjs/tests/test_op_overloading.js ./qjs ~/wslumi.gateway.mgl03/quickjs/tests/test_qjscalc.js |
… quickjs/qjs.c interpreter should fix some issues with quickjs tests failing (#65)
Problem Description:
I found that some test cases in repo QuickJS failed to execute.
Expectation:
All test cases in the directory tests/ of QuickJS would succeed to execute.
Actual test results:
test_bignum.js
Error: SyntaxError: invalid number literal
at /home/oem/path/to/quickjs/tests/test_bignum.js:155
test_closure.js
Error: SyntaxError: invalid keyword: with
at /home/oem/path/to/quickjs/tests/test_closure.js:157
test_language.js
Error: SyntaxError: invalid keyword: with
at /home/oem/path/to/quickjs/tests/test_language.js:379
Error: SyntaxError: a declaration in the head of a for-in loop can't have an initializer
at /home/oem/path/to/quickjs/tests/test_loop.js:144
test_op_overloading.js
Error: ReferenceError: 'Operators' is not defined
at test_operators_create (/home/oem/path/to/quickjs/tests/test_op_overloading.js:39)
at (/home/oem/path/to/quickjs/tests/test_op_overloading.js:205)
test_qjscalc.js
Error: Error: assertion failed: got |false|, expected |true|
at assert (/home/oem/path/to/quickjs/tests/test_qjscalc.js:18)
at test_integer (/home/oem/path/to/quickjs/tests/test_qjscalc.js:52)
at (/home/oem/path/to/quickjs/tests/test_qjscalc.js:245)
Development environment: Ubuntu 20.04
Problem recurrence steps:
cd quickjspp/build/ ./qjs path/to/quickjs/tests/xxx.js
The text was updated successfully, but these errors were encountered: