Source is now scrollable after writing `scroll`.
Keys are `q` to quit, `w` to scroll up `s` to scroll down.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
New api function:
* jerry_get_error_type
Additionally update a few places where this new function
can be used.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
In some use cases, you want to reliably copy jerry strings to buffer, even if it doesn't fit target buffer, but is acceptable to lose some bytes. In those cases, the documentation will now suggest using the substring function as an alternative instead.
JerryScript-DCO-1.0-Signed-off-by: Brian Khuu mofosyne@gmail.com
The length*sizeof(ecma_value_t) may overflow on 32 bit systems which
cause a memory corruption when the values are filled.
Fixes#2182.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Aborts are similar to exceptions except they are not caught by catch
and finally blocks. Callbacks should honor aborts as well and return
them without processing them. Aborts are never thrown by JavaScript
code.
In the future certain events such as out-of-memory condition may
also throw aborts.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Compiled code blocks are sized in multiples of JMEM_ALIGNMENT,
but it's possible that some bytes at the end remain unused and get filled
with junk. This causes snapshot output to become nondeterministic.
To fix this, zero out the compiled code buffer before using it.
JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
New API functions:
- jerry_create_arraybuffer_external
- jerry_get_arraybuffer_pointer
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Since TizenRT doesn't have any commands to get the return value of a process,
added a debug print line that shows the return value.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
Changed regex parsing to be able to handle opening braces
as other engines do, and also added a compile flag which
can disable this behaviour.
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan@inf.u-szeged.hu
Before this patch the JS execution is started right after the parsing
is completed. The problem is that some parts of the JS code is executed
before the debugger had any chance to insert pending breakpoints due
to network latency. This patch adds a delay after parsing when at least
one pendding breakpoint is available.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
By adding version information to the debugger protocol
it is possible to report if the debugger client and server
have different expectations on debugger workings (opcodes, types, etc.).
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Introduced a cmake/toolchain_mcu_artik053.cmake file that defines
all the target specific compiler options.
Modified the Makefile.tizenrt to do not copy the created static
libraries to the TizenRT folder. Instead, the application builder
Makefile (tizenrt-artik053/apps/jerryscript/Makefile) copies the
required static libraries to TizenRT.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
Add C API to work with Array Buffers.
The following methods are added:
- jerry_value_is_arraybuffer
- jerry_create_arraybuffer
- jerry_arraybuffer_write
- jerry_arraybuffer_read
- jerry_get_arraybuffer_byte_length
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Greatly simplify the iterator part and make it compatible with 32 bit cpointers.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Modified the Makefile of the NuttX target to build only the application
file (targets/nuttx-stm32f4/jerry-main.c) and not the whole project.
It helps to build JerryScript separately and use the static libs when
building NuttX.
Also modified the README.md to describe the new build process.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
In 1.10, Zephyr RTOS switched to CMake as means to generate application
makefiles. Consequently, drop Makefile, and introduce CMakeLists.txt,
and update master Makefile.zephyr accordingly.
With these changes, take a chance to make following "cosmetic" changes:
1. Make "qemu_x86" board target the default instead of "arduino_101".
Arduino 101 is just one of the boards of many supported by Zephyr
(and thus JerryScript port), while qemu_x86 is something everyone has.
2. Zephyr make target to run QEMU switched from "qemu" to "run".
3. Don't rely that there's zephyr.strip, it's presence is now
board-dependent. The most we can rely on is zephyr.elf.
targets: zephyr: Remove deprecated prj.mdef file.
MDEF files have been deprecated and ignored for few Zephyr releases.
targets: zephyr: Increase main (i.e. interpreter) thread stack size.
qemu_x86 target now has stack guard enabled by default and it trips with
the default stack size. Set it to 2K for now.
targets: zephyr: Makefile.travis: Update for Zephyr 1.10.
Zephyr 1.10 requires SDK 0.9.2 and CMake 3.8.2.
Also, don't hardcode CC path, it depends on a board and choosed
automatically by Zephyr build system.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
Add new function to avoid code duplication.
Add two new test cases to jerry_exec_snapshot function:
* test enable copy byte-code with global mode
* test enable copy byte-code with eval mode
JerryScript-DCO-1.0-Signed-off-by: Tamas Keri tkeri@inf.u-szeged.hu
This patch uses the onboard RTC for generating random seed. It also improves the print handler to support float values.
The rom segment is slightly increased to fit to the latest master.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This patch adds two new string concatenation functions:
ecma_append_chars_to_string and ecma_append_magic_string_to_string
The former appends a cesu8 byte array and the latter appends a magic string
to the end of an ecma-string. These two free (dereference) their ecma-string
argument, and this change is also applied to the original ecma_concat_ecma_strings
function which simplifies string handling in most cases.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
NuttX and artik053 build - compiling with strict Werror=conversion - fail when jerry-debugger option is enabled.
This patch based on #2007, because most of them are fixed earlier within that PR, but it was closed before the land.
Credit: Piotr Marcinkiewicz p.marcinkiew@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
It wasn't properly checked if the given object was an arrow function, therefore it always got wrongly casted into `ecma_arrow_function_t`.
Fixes issue #2110
*plus fixing a typo in the comments
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This patch improves the ecma_integers_values multiplication by checking if the multiplier or multiplicand is power of 2.
If it is it uses right shift instead of multiplication.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
The affected function calls have been replaced with the appropriate arithmetic operands.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Building with all-in-one and enabled debugger caused
errors as the sleep functions were not defined.
By moving the _XOPEN_SOURCE macro to a generic place
we make sure that the required sleep functions are
present in every case.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
On argument handling:
- Merged all signoff check options into one, option value chooses
between strict/tolerant check variants.
- Added sensible metavars to options with arguments (consistent
with metavars of build.py).
- Reordered options to match the order the checks are executed in.
- Added `--all` alias to `--precommit` check option.
- Beautified code (always placed `help` on separate line, removed
unnecessary arguments of `add_argument` that just repeated their
defaults).
On test runner logic:
There was too many code duplication on how checks were executed, it
got refactored. No change in semantics.
The only change was in Travis CI-related invocations,
`--check-signed-off-travis` had to be rewritten to
`--check-signed-off=travis`.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This patch removes all ecma_make_simple_value calls to make the code more easy to understand.
Also removes the type ecma_simple_value_t which improves the performance in related code paths by calculating the value of new ecma_value_t is no longer needed.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
'ecma_clear_error_reference' must increase the reference of the returned
ecma value referenced by the error if there are more than one reference.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
The test262 python script is not python 3 compatible
so we force it to be executed with python2.
Additionally print out the reason if the execution
failed.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
On Travis the Python (by default) is a bit old
and causes problems when the yotta is being used.
Switching to Python 2.7.13 solves half of the problem.
The other problem is the pyOpenSSL 17.5 and Linux
library incompatibilities. Thus we force the pyOpenSSL
to a pre-17.5 version.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Freezing the global object and later trying to add properties to it caused an assertion error (issue #2105).
This patch fixes the issue.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
Since the JerryScript can able to parse functions directly the
PARSER_LEXICAL_ENV_NEEDED and the PARSER_NO_REG_STORE flags
should be in the context's status flags for executing eval operations
by the debugger.
JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com