This patch fixes the return value of the routine also fixes several incorrect regression-tests
due to the previously incorrect [[RegExpMatcher]] internal slot check.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Until now "get"/"set" were always parsed as special 'keywords' for accessor methods,
but they should be parsed as simple class method if no identifier is followed by them.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
When using ES6 modules it was not possible to identify which module
an error originates from.
This PR changes the error message to also include the file path using
the file:line:column format, and updates the source context printing for
unhandled exceptions to use the correct file.
Co-authored-by: Marko Fabo <mfabo@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This patch slightly reworks the container objects internal objects allocation.
This rework allows the same lifetime of the objects without the manual allocation/deallocation of the internal object.
This patch also fixes#2951.
Co-authored-by: Dániel Bátyai <dbatyai@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
VM_RECURSION_LIMIT only prevented the recursion of interpreted codeblocks but
native/builtin function calls can also create stack overflow due to the too deep recursion.
This patch fixes#2905.
Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Wrong method were used to get the source buffer pointer
Fixes#2851
Co-authored-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This patch fixes#2895 and fixes#2911.
Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
The result of the callback function was not freed
Fixes#2910
Co-authored-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
Construct ecma_string only when there is no parser error using lit_object's index in parser_module_parse_export_caluse and parser_module_parse_import_clause
Fixes#2908
Co-authored-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
After setting a second native pointer, check that both the pointer that
was first set and the second pointer that was set are there.
JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
Right and left value release wasn't complete
Fixes#2901Fixes#2902
Co-authored-by: Tibor Dusnoki <tdusnoki@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
Right_value wasn't correctly freed in case of an error.
Fixes#2894Fixes#2897
Co-authored-by: Tibor Dusnoki <tdusnoki@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
Also implement the missing iterator initializer part from the Map builtin object constructor.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This fixes an assertion failure which was caused by incorrectly importing
the same variables multiple times.
Co-authored-by: Marko Fabo <mfabo@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
A class expression can be part of any kind of expression since the asserts for the stack position calculation were incorrect.
This patch fixes#2819.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This patch reworks the core of the builtin Map object.
Advantages:
- Provide sublinear access time for the elements via Lcache and property hashmap
- This implementation is suitable for the builtin Set object as well
Also add the missing 'forEach' routine for the builtin object as well.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
New API functions:
- jerry_create_dataview
- jerry_value_is_dataview
- jerry_get_dataview_buffer
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Currently JS objects can only have one native pointer data which could be a limitation in special cases.
This patch allows to register multiple native infos, which can be accessed/associated with the corresponding `jerry_object_native_info_t`.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Binary size gain:
- Intel: ~780B (gcc-7.3)
- Arm: ~450B (arm-linux-gnueabi-gcc-7.3)
The change also contains the renovation of each builtin routine to use early return in case of error to make the code less complicated.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Added new test cases to improve branch coverage in Array.prototype routines.
The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file.
https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py
While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs.
Branch coverage including pando-project#2682 and pando-project#2674:
-before: 399 / 476
-after: 472 / 476
There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them.
The other 14 functions are either already covered, or we could not improve the coverage of it.
More information about the coverage improvement and the branches not reached:
https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e
While improving the coverage we found an unnecessary condition check, which can not be false in any cases.
Co-authored-by: Csaba Repasi repasics@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi repasics@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Mate Dabis mdabis@inf.u-szeged.hu