3525 Commits

Author SHA1 Message Date
Akos Kiss
7934117625 Bump Mbed target to Mbed OS 5.11.1 (#2695)
The git hash mbed-os.lib was pointing to marked Mbed OS 5.5.5 and
was more than a year old and more than 10.000 commits behind latest
mbed-os master.

This commit forwards the reference to the latest Mbed OS release
(5.11.1).

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-17 10:38:02 +01:00
Daniel Vince
243f2ffcad Style fix in the lexer.h (#2705)
JerryScript-DCO-1.0-Signed-off-by: Daniel Vince vinced@inf.u-szeged.hu
2019-01-17 07:50:05 +01:00
Robert Fancsik
86e60ddf8d Fix inner classes in class heritage environment (#2686)
This patch is the proper fix for #2667, since #2269 did not fix the problem entirely.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-16 14:36:54 +01:00
t-harvey
cfdb5eddb3 Added the _restore function to "unpop" the argument stack. (#2592)
Added a unit test for the jerryx_arg_js_iterator_restore function.
Added the specification to the documentation.

JerryScript-DCO-1.0-Signed-off-by: Timothy Harvey t-harvey@ti.com
2019-01-16 11:43:36 +01:00
Robert Fancsik
7e3d688e5b Implement the Symbol builtin object (#2601)
This patch contains the base functionalities that the new builtin object requires.

Currently unavailable:
 - print (Symbol('foo')) - this features requires the refactor of the print handler function
 - Several global symbol based builtin routines (follow up patch)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-16 10:09:23 +01:00
Akos Kiss
08c7183ef8 Update slug, org, and project key info for the SonarCloud service (#2690)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-16 16:24:12 +09:00
Kristof Kosztyo
325c426c1e Fix api example in the documentation (#2703)
JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo kkristof@inf.u-szeged.hu
2019-01-15 20:21:58 +01:00
Robert Fancsik
d716f900e1 Fix getting array length in ecma_builtin_promise_do_{race, all} (#2702)
This patch fixes #2700.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-15 17:31:59 +01:00
Robert Fancsik
b4df594d3e Normalize routine's arguments before dispatch (#2687)
Binary size gain:
 - Intel: ~860B (gcc-7.3)
 - Arm: ~660B (arm-linux-gnueabi-gcc-7.3)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-15 16:45:16 +01:00
Akos Kiss
a9c3ddff1f
Bump NuttX RTOS target to 7.27 (#2696)
Both documentation and travis makefile were referring to NuttX 7.22,
which was released in Sep 2017. This commit bumps the version to the
latest release (7.27, from Nov 2018).

Additionally, it also sets the stlink tool to a fixed (and tagged)
version.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-15 14:02:55 +01:00
Robert Fancsik
c305d70b11 Fix "arguments" and "eval" parsing (#2661)
This patch fixes #2656 and fixes #2659 as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-15 13:29:56 +01:00
Peter Marki
98aa08e33c Add subdir-level gitignore to the nuttx target directory (#2635)
JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2019-01-15 11:16:53 +01:00
Robert Fancsik
ee267e8aa9 Add missing ecma_deref_ecma_string in ecma_builtin_typedarray_prototype_join (#2701)
This patch fixes #2698.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-15 09:01:33 +01:00
Akos Kiss
9ced3addaa Bump ESP8266 target to SDK v2.1.0 (#2697)
Until now, the ESP8266 target used a non-tagged git hash revision
of the RTOS SDK (from Oct 2017). Moreover, the compiler was also a
custom-built gcc.

This commit sets the RTOS SDK version to v2.1.0, released Oct 2018,
which is the latest old-style SDK for ESP. The commit also changes
the used gcc to an Espressif-provided pre-built toolchain, which is
tagged for the (latest) v3.0.1 SDK release.

(The SDK bump is not to the latest SDK version because the new
v3.x line of the SDK is "ESP-IDF style", which is incompatible with
the current target code base. On the other hand, the toolchain
comes from the latest SDK release because the v2.x line had no
pre-built toolchain suggestions -- but it builds v2.x sources
correctly.)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-15 08:35:39 +01:00
Robert Fancsik
f02de7a31f Add missing error check in ecma_builtin_promise_do_all (#2694)
This patch fixes #2693.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-14 23:46:01 +01:00
Robert Fancsik
2c031c1220 Implement Object.assign routine (#2678)
Related part of the standard: ECMA-262 v6, 19.1.2.1

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-14 15:04:00 +01:00
Akos Kiss
52fdf4ef3f
Travis CI config maintenance (#2683)
- `sudo: false` has been deprecated.
- `install` step is skipped by default for C projects, so there is
  no need setting it explicitly.
- Homebrew addon can be used to install dependencies for OSX jobs
  (and, by experience, it is a lot faster than manually invoking
  brew).

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-14 14:45:36 +01:00
Akos Kiss
adb80c2045 Update links in docs (#2691)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-11 18:57:30 +09:00
Robert Fancsik
93ec226650 Extract binary lvalue operators (#2630)
This patch substitutes all binary lvalue operators with an assigment + the corresponding binary operator.
E.g. A += (expression) is pasred as A = A + (expression).

Due to this replacement, all the related binary lvalue CBC opcodes can be removed.
Also the arithmetic related VM instructions can put their result directly onto the stack, since no more checking is needed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-10 08:47:45 +01:00
Robert Fancsik
e8502fa8cc Fix class extends value (#2662)
This patch fixes #2658 and ensures that when a class extends value is null and the class has no explicit constructor
the proper error is raised during constructing a class instance.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-09 14:27:50 +01:00
Daniel Balla
3ee771655f Fix JerryScript build with clang-6.0 (#2610)
This patch fixes the following error with Clang-6.0

```
jerryscript/jerry-core/api/jerry.c:1527:71: error: implicit conversion loses integer precision:
      'jerry_regexp_flags_t' to 'uint16_t' (aka 'unsigned short') [-Werror,-Wconversion]
  jerry_value_t ret_val = ecma_op_create_regexp_object (ecma_pattern, flags);
```

Also change the `jerry_create_regexp` and `jerry_create_regexp_sz` functions' `flags` parameter to `uint16_t` since the values created with `bitwise inclusive OR` are not part of the enum.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-01-09 09:22:47 +01:00
Robert Fancsik
99b968de3c Reduce the memory footprint of 'ecma_instantiate_builtin' (#2646)
This patch introduces a new builtin descriptor table to substitute the generated switch-case structure in 'ecma_instantiate_builtin',
also removes the corresponding helpers functions to simplify the instantiation process.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-09 09:04:21 +01:00
Zsolt Borbély
0c20f8e701 Fix broken links in README (#2679)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2019-01-08 09:59:27 +01:00
Akos Kiss
e5fc13f6db Build test disabled jerry-libm (#2681)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-08 09:57:51 +01:00
Robert Fancsik
ef2c3b46d7 Fix super property reference parsing (#2672)
`PARSER_CLASS_SUPER_PROP_REFERENCE` flag should be applied for only binary lvalue tokens.
This patch fixed #2671.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-08 09:33:26 +01:00
László Langó
7b48be81c3
Fixed assertion in RegExp built-in. (#2663)
Fixes #2660

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-01-08 09:04:58 +01:00
László Langó
2f8c0a168f Removed ECMA_TRY_CATCH macros from RegExp built-in (#2642)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2019-01-04 15:12:03 +01:00
Akos Kiss
f2404ac0e1 Simplify the collection of sources in cmake files (#2673)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-04 08:59:15 +01:00
Robert Fancsik
af91072f44 Ensure that ecma_builtin_json_str_helper uses [[DefineOwnProperty]] internal method (#2665)
This patch fixes #2652 and fixes #2653 as well, also reverts #2521.
Related part of the standard ECMAScript v5.1 15.12.3.10.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-03 15:30:22 +01:00
Akos Kiss
1f204de150 Maintenance of fatal code enum (#2670)
- `ERR_SYSCALL` is a legacy that has not been used anymore since
  the removal of jerry-libc. This commit removes it from the port
  API.
- `ERR_DISABLED_BYTE_CODE` is a (relatively) recent addition to the
  fatal code enum. At the time it was added, the documentation has
  not been updated. This commit adds the missing documentation.
  (Plus, it removes a superfluous `JERRY_UNREACHABLE` from after a
  `jerry_fatal (ERR_DISABLED_BYTE_CODE)`.)

Note: As the port API is modified, this is an API-breaking change.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-03 15:27:09 +01:00
Robert Fancsik
b80935ba92 Fix ecma_op_resolve_reference_base for super object bound lexical environments (#2668)
All ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND type lexical environments should return their outer reference during resolving syntactic reference.
This patch fixes #2666.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-03 13:37:01 +01:00
Robert Fancsik
1068b07cbe Ensure that inner classes do not inherit the parent's class HAS_SUPER flag. (#2669)
This patch fixes #2667.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-03 13:36:37 +01:00
Robert Fancsik
b69f3fd0ff Add missing error check after vm_op_get_value (#2655)
This patch fixes #2654.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-02 12:56:02 +01:00
Akos Kiss
aae50c9da0 Simplify version key in AppVeyor configuration (#2650)
The format `1.0.{build}` is artificial, the 1.0 prefix has no
meaning, `{build}` is enough.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-01-02 10:11:02 +01:00
Robert Fancsik
ec142f5ff6 Fix the Map builtin name property (#2648)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-12-19 13:00:54 +01:00
Akos Kiss
ae91800e4b
Ensure fresh Python 2.7 on Trusty and compatible Intervaltree (#2645)
Recent failures of the Mbed OS target came from two independent
issues:
- some python packages started requiring Python>=2.7.10, and
- the latest Intervaltree 3.0.0 release was released broken.

This patch ensures a fresh python by 'lying' to the CI that this
is a Python project (Python images on the CI come with a recent
interpreter, not with the one shipped as default with the OS), and
locks Intervaltree to a stable version.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-12-17 16:15:14 +01:00
Daniel Balla
a1595fa23a Fix possible failure in backtrace info (#2643)
Make sure to ignore static snapshots when sending backtrace information to the debugger.
The `JMEM_SET_NON_NULL_POINTER` macro requires the frame context's `bytecode_header_p` pointer to be a heap pointer, but due to the static snapshot it might not be, causing an assertion failure.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-12-17 00:17:11 +01:00
Akos Kiss
5779a5b8a8 Fix MbedOS build (#2644)
Since recently, the newly released mbed-host-tests 1.4.4 gets
installed during the python requirement installation step. That
package requires pyocd>=0.14.0, which cannot be satisfied for
whatever reason. This quick fix pins mbed-host-tests to version
1.4.2, which does not have unsatisfiable requirements.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-12-14 18:08:32 +01:00
Akos Kiss
8ed5078e96 Rewrite debugger test runner to use portable redirect-and-append notation (#2641)
The test runner used `&>>` to channel stderr to stdout and append
all that to a file. However, that's Bash 4 syntax, which is not
available everywhere, e.g., on MacOS. Bash pre-4 syntax requires
the classic `>>file 2>&1` notation.

This commit rewrites the test runner to use the portable syntax.
Moreover, it also rewrites `&>` to `>file 2>&1` for the sake of
consistency.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-12-14 12:54:46 +01:00
László Langó
9b24bde4c6 Fixed connection lost of debugging sessions. (#2636)
The peek of the socket does not work on other platforms,
beacause the errno is not set correctly. The code path
added by #2427 Linux specific, so it has been guarded
to solve connection lost issues during debugging sessions
when the client does not send data but still connected.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-12-12 15:41:42 +01:00
Robert Sipka
93e71150fe
Update the storage locations of the status badges (#2639)
The name of the database has been changed to jsremote-testrunner from remote-testrunner

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2018-12-12 13:43:26 +01:00
Zoltan Herczeg
83ee9cfca3 Fix named function expression creation. (#2634)
Create a local lexical environment with the name of the function. While
this is not too memory efficient, some corner cases requires its existence.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-12-12 12:50:03 +01:00
Robert Fancsik
4f0b075f85 Implement ES2015 {Array, %TypedArray%}.prototype.find routine (#2631)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-12-12 10:13:05 +01:00
Daniel Balla
c6a2fd5d3d Fix an issue while debugging with static snapshots (#2606)
The issue was found when debugging IoT.js with static snapshots turned on, if an error was thrown an assertion failure was caused. The reason is the frame context's bytecode_header_p pointer was not a heap pointer. The jerry_debugger_breakpoint_hit function tries to set a compressed pointer which points to bytecode_header_p with the JMEM_CP_SET_NON_NULL_POINTER macro, which has an assertion that requires the above mentioned bytecode_header_p to be a heap pointer, which is obviously not.


Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-12-11 18:51:00 +01:00
Robert Fancsik
101f62ce9d Improve the vm_loop suspending for exec operations (#2589)
Exec operations{call, construct, super_call} related bytecode sequences no longer executed twice.
The execution continues with the next opcode or a specific bytecode sequence if an error occurs during the operation.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-12-06 15:36:26 +01:00
Robert Fancsik
79b2df124e Separate VM_OC_PROP_GET to a single operation in vm_loop (#2607)
VM_OC_PROP_GET is the general vm instruction for getting an object's property.
This opcode can be mutated into several other opcodes depending on the context (pre- post increment, ident reference).
Since these mutated opcodes perform additional checks and VM_OC_PROP_GET is a highly frequent instruction and it is worth to introduce a special case for it.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-12-06 14:31:30 +01:00
Roland Takacs
3f9dd0f1f9 Use Thumb instructions on TizenRT. (#2629)
In order to decrease the binary size of JerryScript, enabled the Thumb
instruction set that is supported on ARM Cortex-R series processors.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
2018-12-02 09:56:27 +01:00
Zoltan Herczeg
bc1b13dcb6 Fix floating number parsing. (#2628)
This patches fixes floating point number parsing when the number starts with dot.

Fixes #2614.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-12-01 17:22:39 +01:00
László Langó
a08291eb12 Unify the usage of boolean value creations. (#2623)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-11-30 11:33:30 +01:00
Robert Fancsik
6dfa4efbfb Remove unnecessary check from VM_OC_NOT (#2622)
This patch removes the ECMA_IS_VALUE_ERROR check from VM_OC_NOT, since the general toBoolean operation cannot throw an exception.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-30 07:45:48 +01:00