3525 Commits

Author SHA1 Message Date
Robert Fancsik
99c7a4040f Super parsing options should be set only in direct eval call (#2863)
This patch fixes #2846.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-05-10 12:23:29 +02:00
Robert Fancsik
063e7fde2b undefined byteLength should be treated 0 in DataView constructor (#2856)
This patch fixes #2854.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-05-10 10:47:25 +02:00
Dániel Bátyai
4bdc3a1c46 Implement path normalization in port-default (#2861)
Updated the default port so that it now provides path normalization for
common platforms.

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
2019-05-09 18:31:58 +02:00
Dániel Bátyai
57f08ee70e
Add NuttX specific port implementation. (#2864)
The NuttX target has been problematic for some time, due to the fact
that NuttX apps are built with NuttX's own libc implementation, while
the default-port in JerryScript was compiled with the host libc, which
caused a mismatch between the two.

In order to work around this issue, most of the port implementation is already
duplicated in the NuttX target's jerry_main.c.

This PR adds a NuttX specific port implementation by moving the already
implemented port functions from jerry_main into a separate file, adding
implementation for the missing functions, and disabling the default-port
in JerryScript.

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
2019-05-09 16:33:25 +02:00
László Langó
0e41311989 Fixed build issues with ES2015 subset profile on Windows. (#2865)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-05-09 16:31:54 +02:00
Robert Fancsik
2d1ad149c1 Fix key iteration in ecma_op_map_foreach (#2855)
This patch fixes #2852 and fixes #2853 as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-05-08 15:21:43 +02:00
Robert Fancsik
eb993d57ed DataView object underlying ArrayBuffer should be marked during GC. (#2849)
This patch fixes #2848 and fixes #2850 as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-05-08 15:14:21 +02:00
László Langó
372ebd8260 Fixed linker issues of handle scope in jerry-ext on Windows platform. (#2862)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-05-08 11:42:02 +02:00
Dániel Bátyai
3ec6b68063
Clear top module context after local variables have been imported (#2859)
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
2019-05-06 17:35:33 +02:00
Mate Dabis
3823d2fc81 Fixed typo in parser (#2860)
JerryScript-DCO-1.0-Signed-off-by: Mate Dabis mdabis@inf.u-szeged.hu
2019-05-06 12:57:14 +02:00
Daniella Barsony
a2e7816485 Update README (#2844)
Removed Artik053 and updated the links to the measurement site.

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-04-30 15:20:38 +02:00
Dániel Bátyai
1cdb3c6c56 Fix identifier handling inside export statements (#2843)
Fixes #2842

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
2019-04-30 10:53:48 +02:00
legendecas
097e1862d2 Set constructor to prototype for ES2015 Classes (#2818)
JerryScript-DCO-1.0-Signed-off-by: legendecas legendecas@gmail.com
2019-04-29 13:36:23 +02:00
Robert Fancsik
56b6d3a45d Class this binding must be bound to non-heritage contexts as well (#2829)
This patch fixes #2822.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-26 13:34:02 +02:00
Daniel Vince
37b7645e6a Rework ES2015 module system and add missing features. (#2792)
Co-authored-by: Dániel Bátyai <dbatyai@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Daniel Vince vinced@inf.u-szeged.hu
2019-04-25 14:57:17 +02:00
Robert Sipka
938e9c7530 [Debugger] Fixes the processing methods of incoming part messages (#2840)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2019-04-25 13:43:33 +02:00
László Langó
806b9f05c0 Fixed build failure caused by conversion warning with GCC-5.4 (#2839)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-04-25 10:27:52 +02:00
László Langó
a6a7d8c7b8
Make the underlying buffer of the ArrayBuffer accessible. (#2836)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-04-24 16:03:56 +02:00
Akos Kiss
c4ac67d4af Bump Zephyr target to 1.14.0 (#2837)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-04-24 14:47:58 +02:00
Philippe Coval
d3234c2b8c Add STM32F7 support (#2838)
Some flags are not defined because,
they can be deduced from CPU type.

It was tested on NucleoF767ZI running current NuttX master branch.

Change-Id: I68c9787fe3003338228f47fbaf3e7a9522bcd6d5
Forwarded: https://github.com/pando-project/jerryscript/pull/2838
Relate-to: https://github.com/pando-project/libtuv/pull/136
JerryScript-DCO-1.0-Signed-off-by: Philippe Coval p.coval@samsung.com
2019-04-24 14:46:14 +02:00
Robert Fancsik
10d820165d Enable 32bit cpointers by default if the given heap size is greater than 512KB (#2833)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-24 14:41:07 +02:00
Robert Fancsik
6801871161 Super parse options should be cleared before setting it's value (#2831)
This patch fixes #2825.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-24 14:40:09 +02:00
Robert Fancsik
962d549be6 Non-object values should give early false result for instanceof operator (#2830)
This patch fixes #2823.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-24 14:39:04 +02:00
Robert Fancsik
760fc4fb95 Remove incorrect assertions from class construction instructions (#2827)
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
2019-04-24 14:36:19 +02:00
jerry-weng
9d7a0db0dd Add missing jerry_release_value by calling jerry_set_property and jerry_set_property_by_index (#2821)
JerryScript-DCO-1.0-Signed-off-by: jerry-weng jjweng2007@gmail.com
2019-04-18 11:24:27 +02:00
László Langó
5be93dc7f7
Minor fixes of the documentation (#2834)
* Fixed wrong file name indexes in the docs folder.
 * Added description of the logging options into the getting started guide
 * Added missing files to the 'update-webpage.sh' script

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-04-18 10:16:45 +02:00
Robert Fancsik
d2931c6e40 Rework Map object (#2760)
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
2019-04-17 14:50:03 +02:00
László Langó
bc9efb07a5
Updated the API reference (#2828)
Fixed style issues, fixed inaccurate descriptions and added missing information.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-04-17 11:45:33 +02:00
Robert Fancsik
5c72d995e4 Implement DataView builtin (#2804)
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
2019-04-16 08:26:39 +02:00
Robert Fancsik
b3f4aa6816 Allow the JS objects to have more than one native pointer data (#2814)
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
2019-04-16 07:50:49 +02:00
Robert Fancsik
c818930cdc Use custom dispatcher for Global object's routines (#2794)
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
2019-04-16 07:48:04 +02:00
lidija-b
e944cdaa8b Add endian set for default toolchain (#2808)
When default toolchain is used and architecture not listed in
"#if" in jerry-libm-internal.h on little endian around 90
test-suite tests, 4 unittests and 30 jerry-tests fails depending
on setup tested.
This change checks endians in case no toolchain is found and
sets __LITTLE_ENDIAN macro if it is little endian. This way
it will be set for any future arhitectures using little endian
and architecture that can have both big and little endian not
listed in jerry-libm-internal.h check.

JerryScript-DCO-1.0-Signed-off-by: Lidija Besker lidija.besker@rt-rk.com
2019-04-12 16:32:58 +02:00
Mate Dabis
09d8793e30 Increase branch coverage: Array.prototype functions (#2796)
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
2019-04-12 14:00:44 +02:00
Robert Fancsik
48cec485e1 Identifiers should be stored in the lexical environment if argument object needs to be created (#2816)
This patch fixes #2699.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-12 13:48:02 +02:00
Péter Gál
40f7b1c27f Rework usages/naming of configuration macros [part 1] (#2793)
There are quite a few configuration macros in the project.
As discussed in the #2520 issue there are a few awkward constructs.

Main changes:

* Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format.
* The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins.
* Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format.
* The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins.
* Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
* All options (in this change) can have a value of 0 or 1.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
  JERRY_REGEXP_STRICT_MODE is set to 0 by default.
* Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now
  it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point
  number.
  By default the 64-bit floating point number mode is enabled.
* All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to
  test if the feature is enabled or not.
* Added/replaced a few config.h includes to correctly propagate the macro values.
* Added sanity checks for each macro to avoid incorrectly set values.
* Updated profile documentation.
* The CMake feature names are not updated at this point.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-04-09 10:14:46 +02:00
Daniella Barsony
722d092528 Add missing port functions for artik053 target (#2811)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-04-03 11:20:57 +02:00
László Langó
89cf1a988c Run test262 test suite in both release and debug mode on Travis CI. (#2810)
The CI ran test262 test suite in release mode only to save time.
This patch enables the debug testing on the test suite, which means
the runtime of the "Conformance Tests" job will increase by a few
minutes.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-04-02 20:26:21 +02:00
Robert Fancsik
4b9fee1ba0 Fix typo in the API documentation (#2809)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-02 10:13:41 +02:00
Péter Gál
3f6599c358 Add a "single" source/header file generation and build mode (#2790)
Introduce a new way of building: before any file is compiled
all source files are combined into a single C file and all
header files into a single H file (per subdir).

This new approach makes it possible to quickly integrate JerryScript
into other projects:

```
$ gcc -o demo demo.c jerryscript.c jerryscript-port-default.c -lm
```

To use the source generator run:
```
$ cmake -Bbuild_dir -H. -DENABLE_ALL_IN_ONE_SOURCE=ON
$ make -C build_dir generate-single-source
```

This will create the following files in the `build_dir`:
* jerryscript.c
* jerryscript.h
* jerryscript-config.h
* jerryscript-port-default.c
* jerryscript-port-default.h

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-04-01 11:06:13 +02:00
Robert Fancsik
e063b8af80 Fix bound functions with no arguments after #2801 (#2805)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-03-29 12:13:27 +01:00
László Langó
4a67f131bb
Fixed typo in README.md of particle target. (#2806)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-03-29 12:09:25 +01:00
Robert Fancsik
f23c746b45 Merge external direct magic strings into direct magic strings (#2766)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-03-29 09:38:54 +01:00
László Langó
6efdb283aa Fixed 'jerry_get_object_keys' API function. (#2807)
'jerry_get_object_keys' always gave back an empty array.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-03-28 19:02:44 +01:00
legendecas
5b29bf6288 Implement handle scope API in jerry-ext (#2753)
JerryScript-DCO-1.0-Signed-off-by: legendecas legendecas@gmail.com
2019-03-27 14:49:59 +01:00
legendecas
772ab277ea Fixes assertion on calling String builtin with symbol (#2803)
JerryScript-DCO-1.0-Signed-off-by: legendecas legendecas@gmail.com
2019-03-26 16:14:04 +01:00
Robert Sipka
3d656cdf57
[Debugger] Implementation of transport over serial connection (#2800)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2019-03-26 09:39:51 +01:00
Robert Fancsik
0981985134 Remove outer loop from ecma_op_function_call (#2801)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-03-25 15:11:06 +01:00
Akos Kiss
61a79af8c1 Bump RIOT OS target to 2019.01 (#2786)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-03-22 09:46:19 +01:00
Robert Fancsik
7b23ecc272 Merge base resolve + get/put operations for lexical environments to increase performance (#2798)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-03-21 09:45:56 +01:00
Daniel Vince
4123f35a3b Part I: Implement ES2015 module system. (#2599)
JerryScript-DCO-1.0-Signed-off-by: Daniel Vince vinced@inf.u-szeged.hu
2019-03-18 16:22:06 +01:00