2584 Commits

Author SHA1 Message Date
fbmrk
44833cf7be Fix code inserting in API-REFERENCE.md (#1928)
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-07-19 11:25:33 +02:00
László Langó
0ef9b8e027 Fix RegExp character class compilation on unicode ranges.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2017-07-19 10:26:23 +09:00
Sanggyu Lee
5fd98fa2be Change tizenrt-artik05x port reference board to artik053
Artik053 board is publicly announced about one month ago.
So I updated tizenrt-artik05x reference board from sidk_s5jt200 to artik053.
Now, tizenrt-artik05x port works with latest TizenRT repo on artik053 board.

Also, I replaced str_to_uint to strtol since #1891 is landed.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-07-19 10:15:52 +09:00
Marko Fabo
270dbb00b2 error_name must be freed before return
Fixes #1918

JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-07-19 07:19:02 +09:00
Gabriel "_|Nix|_" Schulhof
66b2a7670f New extension: module (#1863)
This extension provides the following facilities:
  - registering modules,
  - module resolvers, and
  - an API for retrieving a module instance given its name.

A module is defined as a global static structure containing a pointer
to a string which is the name of the module, and a pointer to a function
which will be called when an instance of the module is needed.

A module resolver is a function that accepts a string holding the name
of the module and returns a `jerry_value_t` in an out-parameter and
`true` if the module was found, or `false` if it was not. If it returns
`true` and the out-parameter has the error flag set then the API will
pass it through without caching.

This extension provides a built-in module resolver which attempts to
load modules that follow the above module definition.

The API provided by this extension invokes all module resolvers it
receives in sequence to attempt to resolve the name of a single module.
After one resolver returns `true` and a `jerry_value_t` that represents
the module the API stops iterating over the remaining resolvers and
caches the value if its error flag is not set. It then returns the
`jerry_value_t`. The API will return a `jerry_value_t` containing an
error indicating that the module was not found if it reaches the end of
the list of resolvers. The error it returns has an extra property
`"moduleName"` the value of which is a string containing the name of the
module that the API was asked to resolve.

JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
2017-07-18 15:54:24 +02:00
yichoi
5f2c72c472 Add test result information to the README.md (#1911)
JerryScript-DCO-1.0-Signed-off-by: Youngil Choi duddlf.choi@samsung.com
2017-07-17 13:40:56 +02:00
Osamu-Nakamura
bb8ac29cce Revise the mistake in the example function described in "Step 5. Description of JerryScript value descriptors in docs/03.API-EXAMPLE.md (#1919)
JerryScript-DCO-1.0-Signed-off-by: Osamu Nakamura osamu.nakamura.xt@renesas.com
2017-07-16 10:32:01 +02:00
Akos Kiss
1f7606fc05 Improve pylint runner script (#1915)
- On OSX, `find` is more picky about its arguments than on Linux
  and requires the start directory(-ies) to be explicitly mentioned
  before the expressions (a.k.a. "primaries"). However, until now,
  the `pylint` runner script called `find` without a start dir,
  which caused an error on OSX.

- Until now, `find` looked for python scripts in all subdirectories
  of the project, causing `pylint` to check scripts under `targets/`
  and `tests/test262` (if `test262` was checked out). However, the
  files under `targets/` are less strictly controlled while
  `test262` is completely beyond the control of the project. This
  caused a lot of superfluous lint warnings.

This patch makes the `pylint` runner script call `find` in the
cross-platform way, and also limits the scope of the lint checks to
the `tools/` and `jerry-debugger/` directories.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-07-14 19:53:59 +02:00
yichoi
0844499cec Add IRC badge for convenience (#1920)
JerryScript-DCO-1.0-Signed-off-by: Youngil Choi duddlf.choi@samsung.com
2017-07-14 17:52:36 +02:00
Zidong Jiang
8c9b0d4086 Fix empty string issue in ext/args (#1921)
Now the js string "" can be converted to C array by jerryx_arg_string

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-07-14 17:41:02 +02:00
Akos Kiss
00f93bc287 Add support for doctests (#1909)
Markdown files in the docs/ directory can now be annotated to turn
fenced C code blocks into unit tests. The recognized syntax is:

    [doctest]: # (name="test.c", test="run")

    ```c
    // unit test code
    ```

The commit also fixes the issues revealed during the initial
annotation.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-07-14 16:18:20 +02:00
Robert Fancsik
3d744c958f Shifting array element down in the tree must be finished even if an error occurs
Fixes #1671

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2017-07-13 17:54:14 +09:00
Daniel Balla
dbfb0170c1 JerryDebugger breakpoint system rework (#1908)
Reworking the python JerryDebugger breakpoint system.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2017-07-13 10:26:14 +02:00
Robert Sipka
89015a6119 Improve split method to gain memory (#1893)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2017-07-10 10:49:16 +02:00
Martijn Thé
91912689ad Fix hash calculation for strings created using jerry_create_string_from_utf8 (#1912)
The hash was being calculated over the bytes *after* the actual string bytes.

JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
2017-07-10 08:53:58 +02:00
Akos Kiss
18283d22c0 Make debugger port runtime configurable
Convert debug server port from a compile-time constant to a context
variable. This enables each engine instance (either running in the
same process or in different processes) to listen for connections
at different ports, i.e., multiple engines can be debugged at the
same time on the same machine.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-07-06 07:08:00 +09:00
fbmrk
cfa4fdd1ef target: mbedos5: unnecessary acquire and argument check bug (#1892)
When you cleanup the engine you got an `ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)` error.
There is an unnecessary call of jerry_acquire_value which causes the problem.

Also in the InterruptIn-js.cpp file there is a wrong check of an argument.

JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-07-05 23:09:10 +02:00
fbmrk
d3cf335dad target: mbedos5: fix mbedignore (#1894)
Ignoring the entire jerry-port/default library causes a link error, because of the need for the defaultx-handler.c source file.

JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-07-04 11:54:36 +02:00
Sanggyu Lee
0b08322a21 Fix build warning in jerry-ext/arg on tizenrt-artik05x
tizenrt-arttik05x treats warning as error for uninitialized use.
This patch fixes the error in jerry-ext/arg by initializing to zero.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-07-04 16:20:44 +09:00
Youngil Choi
a823169bde Add daily measurement information to READ.md
JerryScript-DCO-1.0-Signed-off-by: Youngil Choi duddlf.choi@samsung.com
2017-07-04 15:09:25 +09:00
Zoltan Herczeg
e6832f5f27 Rework argument parsing.
Heavily simplify the interface of CLI.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-07-04 08:56:55 +09:00
Sanggyu Lee
6b0d9e1b6a Throw SyntaxError for identifier with supplementary character
Fix assertion failure issue #1871 on github.
Don't allow supplementary character as identifier start or part.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-07-03 08:31:20 +09:00
rerobika
f359eb2d1b Stack data should be freed for while statements after the expression is parsed (#1897)
Fixes #1873.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2017-06-30 10:29:19 +02:00
rerobika
3c992de2b8 Fix a build error (#1895)
Fixed an error when neither of libraries are found the build fails.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2017-06-29 12:11:18 +02:00
rerobika
c31e8b8c17 Add timeout to jerry_debugger_receive (#1885)
Fixed when debug server uses a CPU core on 100%.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2017-06-28 11:26:45 +02:00
Akos Kiss
2f140e3b7f Add strtol to jerry-libc and make use of it in jerry-main (#1891)
As a side effect, refactor the variable types in
`print_unhandled_exception` to reduce the overuse of sized integer
types (generic `unsigned int` is better than `uint32_t` if there is
no actual requirement on integer width).

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-06-26 17:10:07 +02:00
Zidong Jiang
b153475093 add transform functions for integer in jerryx/arg (#1883)
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-06-21 19:32:13 -05:00
Zidong Jiang
e4eecc2019 add transform_object_properties in jerryx/arg (#1879)
Add a function in jerryx/arg.
jerryx_arg_transform_object_properties, it will validate the properties of a JS object, and convert those properties into native type.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-06-19 19:51:08 -05:00
fbmrk
7cc9d65c09 target: mbedos5: use jerry-ext (#1889)
Update target mbedos5 to use external function handlers: `assert`, `gc` and `print` from jerry-ext.

JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-06-16 20:25:00 +02:00
fbmrk
70b078faa4 Update target mbedos5 README. (#1880)
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-06-16 09:57:56 +02:00
Martijn Thé
b947f56fd0 Add jerryscript-ext/autorelease.h with JERRYX_AR_VALUE_T (#1874)
JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
2017-06-16 00:09:19 -05:00
Zidong Jiang
940f1f89c9 Check if it is object in Promise.prototype.then
Fix issue #1881

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-06-08 17:08:20 +09:00
Péter Gál
d56713b9af When compiling with gcc 7 the current fallthrough comments (#1878)
are not accepted. This is a bug in gcc 7.

For now disable the fallthrough comment detection.
Disabling the check does not introduce any risk
as previously it was not enabled by default and
vera++ already check these kind of comments.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2017-06-08 17:07:40 +09:00
Péter Gál
add60865e0 Rename files under jerry-code/debugger to avoid build fails (#1877)
Without the file renaming there are two jerry-debugger.c files.
Thus when the jerry-core archive is created there are two objects
in it with the same name. Generally this does not create any problems.
However if the archive is extracted then the second object file
will overwrite the first one which results in undefined reference
linkage error.

The jerry- prefix was removed from the file names and
fixed the include oreders where it was needed.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2017-06-07 08:39:30 +09:00
Akos Kiss
905cd705ef CMakeLists maintenance (#1826)
Removed various superfluous declarations, and rewrote some parts to
be nicer or more consistent.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-06-06 09:08:14 +02:00
Zidong Jiang
11d5402c35 Allow out_native_pointer_p in jerry_get_object_native_pointer to be NULL (#1876)
Support those cases when the existence of the native property is checked.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-06-05 10:44:56 +02:00
Daniel Balla
13930a1cd4 Fix exception argument check (#1875)
The If case didn't work properly when 0 was given to the --exception option.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2017-06-02 12:25:29 +02:00
Daniel Balla
5eb00b7ae0 Add command line option to exception and display commands (#1872)
You can now set --display and --exception parameters in the command line.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2017-06-02 10:40:12 +02:00
Robert Sipka
ddbe067dee Set log level to JERRY_LOG_LEVEL_DEBUG when using show-opcodes on nuttx-stm32f4 target (#1869)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2017-06-01 08:51:15 +09:00
Zoltan Herczeg
a9e7dd7b91 Check breakpoint stop condition in VM. (#1868)
Check breakpoint stop condition even after a message is processed.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-05-31 12:53:25 +02:00
Zoltan Herczeg
efdc06996b Improve instance management in JerryScript. (#1849)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-05-31 15:53:53 +09:00
Daniel Balla
b17a628c19 Add --color option to python debugger (#1865)
Adding --color option, highligthing the number of lines, the pointer and the actual breakpoint.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2017-05-31 08:53:55 +09:00
Daniel Balla
712d5ca8b7 Python debugger source & display command (#1850)
Reworked source(src) command to display a given range of the code, defaults to 3.

Added display command which does the same as the source, except it displays the source code everytime a breakpoint is hit.

Made tests for display, extended tests for src.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2017-05-30 10:58:34 +02:00
Sanggyu Lee
ae60ff0aa3 Handle negative zero in number multiplication (#1856)
Keep sign for zero.
For example, 1 / (0 * (-1)) should be -Infinity, not +Infinity.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-05-30 10:57:32 +02:00
László Langó
631e9f9f80 Update the API examples to use print from extensions (#1846)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2017-05-30 09:59:49 +02:00
yichoi
783dcec6df Add license report and scan status with FOSSA (#1862)
JerryScript-DCO-1.0-Signed-off-by: Youngil Choi duddlf.choi@samsung.com
2017-05-30 16:11:46 +09:00
Jan Jongboom
37ed82437b target: mbedos5: Update to mbed OS 5.4.5 (#1853)
Also ignore the default jerry-port - see also #1847. Re-implement the `print()` function, as it's no longer part of core Jerry, but our programs still depend on it.

JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
2017-05-30 09:09:09 +02:00
fbmrk
a8a25e7f3c Update mbedos5 make (#1847)
Fix make clean and ignore jerry-port-default

JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
2017-05-30 08:58:03 +02:00
Gabriel "_|Nix|_" Schulhof
708b155f38 Clean up property existence check inconsistencies (#1860)
`jerry_has_property ()` and `jerry_has_own_property ()` are inconsistent
in that they squash their return value into a `bool` when in fact it is
a `jerry_value_t`, thereby giving the wrong impression that a property
is there when it isn't and encouraging the leaking of `jerry_value_t`s
by disguising them as `bool`s.

Fixes https://github.com/jerryscript-project/jerryscript/issues/1859

JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
2017-05-29 15:54:32 +02:00
Paul Sokolovsky
b51b6824bb targets: zephyr: Reinstate "print" function and error printing. (#1851)
Re-add "print" function following resent refactors when it was moved
from jerry-core to jerry-ext. This is done in particular to keep
detailed messages on errors.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2017-05-25 09:08:34 +02:00