The change makes the jerry_value_is_promise api method
available in all cases, just like other promise api methods
JerryScript-DCO-1.0-Signed-off-by: Tamas Keri tkeri@inf.u-szeged.hu
This patch fixes#2106. The problem was that the function always tried to transform the array-like object to TypedArray object even if there was an error during TypedArray creation.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This patch fixes#2108. The problem was if the convertible number had less significant fractions digits than the requested, the result was filled with memory junk instead of zeros.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Until now, the engine's feature set was configurable either via
`CONFIG_*` macro guards defined individually on compiler command
line or via profiles (which are text files listing macro guards,
picked up by the cmake build system and turning them into compiler
command line options). And the features under profile control are
all enabled by default (i.e., all macros are `CONFIG_DISABLE_*`).
This causes a maintenance issue when new features are added to the
engine, because the disabling macros have to be added to all
profiles that don't include the new features. This can even cause
"compatibility break" for applications that embed JerryScript but
don't use the cmake or the python build system, because then
profiles are unavailable and all feature disabling guards have to
be explicitly passed to the compiler. (I.e., if such an application
wants to use the ES5.1 feature set, it must define all the ES2015
disable macros; if the engine is developed further and a new ES2015
feature gets implemented, then the new feature will sneak into the
application's binary unless its own build system is changed to add
the new feature guard.) Even the in-repo example Curie BSP target
seems to have suffered from this maintenance problem.
This patch introduces two new grouping macro guards that enable the
disabling of all ES5.1 builtins and all ES2015 features. As the
grouping logic is in config.h, the maintenance of non-cmake-based
build systems becomes easier (and there is no change for the python
and cmake-based build systems).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This patch fixes this bug which caused corrupted stack by preventing unnecessary double to ascii conversion even if
the convertible number of digits is higher than allowed.
In addition, improved ecma_double_to_binary_floating_point function by removing a needless buffer.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Fixes issue #2073, which introduced an error caused by Date.parse()
The problem was that the function didn't properly check if there was a ':' after the hours.
If any UTF8 character was inserted there which got decoded into multiple characters, it caused the pointer to point at a wrong character.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
Fixed an unhandled corner case while parsing slashes and template literals.
This patch fixes#2039 and adds a test case for it.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This patch extends the infinity and zero parsing of the convertible number by checking the normalized number exponent part.
This improvement prevents the engine's hanging while converting extreme big numbers.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This change frees up the error bit in ecma_value_t, which allows
to define 4 more value types (e.g. symbols). To keep API
compatibility we introduce a box for values with error flag.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Added two new api functions:
* jerry_parse_and_save_function_snapshot
* jerry_load_function_snapshot_at
The jerry_parse_and_save_function_snapshot function allows
creating snapshots from snapshot arguments and body source.
The jerry_load_function_snapshot_at function enables loading
back functions from a given snapshot as a JS function object.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
* Replace JERRY_JS_PARSER feature guard with JERRY_DISABLE_JS_PARSER
All feature guards of jerry-core are deciding about the inclusion
or exclusion of a feature based on the state (defined or undefined)
of a macro -- except for the JS parser guard, which requires
`JERRY_JS_PARSER` to be defined with a value of either 0 or 1. This
has some issues:
- The engine cannot be built with a "clean" compiler invocation,
i.e., without any `-D` command line macro definitions. This is
painful for targets that must use a different build system from
the project's own python/cmake-based one.
- Some build systems in targets and even some code in jerry-code
are already confused about the different semantics of
`JERRY_JS_PARSER`, and simply define it without a value and make
decisions based on the macro being simply defined or not.
This patch renames the guard to `JERRY_DISABLE_JS_PARSER` and makes
use of it in jerry-core based on its state, not based on its value.
As obvious from the guard name, the default for the JS parser is
that it is included in the build.
The patch also touches those targets in the repository that
explicitly defined the original macro (correctly or incorrectly).
* Make cppcheck verbose
Cppcheck can be quite slow sometimes, especially on Travis CI,
which has a "10 mins without output means failure" rule. As the
code base of the project grows, we start to undeterministically
fall over that limit. Thus, this PR makes cppcheck verbose to
ensure that it keeps Travis CI continuously fed with output.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This patch adds an extension to snapshots which allows storing
multiple position independent primary functions in a single
snapshot data. A new application called jerry-snapshot is
added to the project to manage snapshots. Currently the only
option is merging snapshots.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Note: the special this behaviour of arrow functions is not implemented.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This patch adds direct function source code parsing, which
is useful to avoid source code duplications. The patch
also improves the Function constructor.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
The jerry_debugger_wait_and_run_client_source function is renamed to
jerry_debugger_wait_for_client_source and a callback is added which
is called when the source is received. Inside the callback the
application is free to do anything with the received source code.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Issue #1990 revealed an unhandled corner case while parsing pattern. This patch fixes it and also adds a test case.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This unreported test issue revealed an assertion in jmem_heap_finalize ().
During the conversion the lot of additional information what a cesu8 represented string needs caused overflow while setting the new ecma_string_t variable's length. This patch fixes this issue and the mentioned test case is available here:
https://gist.github.com/rerobika/3bd590fdcf664a3fcfcc98f11b14c74e
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
- The context reset request message can be sent anytime from a client.
- After the message received the engine will call the cleanup and init
when in the source waiting mode (which means the currently processed file will be executed).
- After the reinitialization is done, the engine will wait
for a new client connection(rest of the work is the client's responsibility).
JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
* Remove 'jerry_debugger_cleaup'. Do it automatically in 'jerry_cleanup'.
* Updated the documentations.
* Updated the NuttX and Artik053 targets.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
If a literal was assigned the unused flag it wasn't freed, however it could have been not empty, therefore should've been freed.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
The function jerry_debugger_send_output wasn't placed correctly in the public API.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
The radix conversion code path was very messy which made it hard to understand
what was happening inside of it. The code got cleaned up, and a lot of comments
were added that explain what is happening and why.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
Functions has several built-in non-enumerable properties, and
they are correctly ignored during enumeration after this patch.
External function prototype is also lazy enumerated.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
So far a freed variable was tested during error flag inspection.
This patch fixes it and #1972 as well.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Sending the output to the debugger client, at the moment only the JS side prints are sent over.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
Several properties of strict and bound functions are moved to
lazy property instantiation. The memory consumption of bound
functions are also reduced when only a this is present.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
The buffer size was previously badly computed since scale == 0 case was not checked, therefore the buffer size was smaller than intended.
This patch fixes this issue.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Whit this enhancement the debugger can able handle more than one source file across the new source wait mode.
This feature can be used by the python client with the --client-source [paths] switch.
The client will store every source path, when the debugger send a signal about the waiting status, then the client will send one file from the list.
JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
Currently new ArrayBuffer(length) does not conform to ES2017.
Major JS implementations follow ES2017 for ArrayBuffer(length).
For example, new ArrayBuffer(length) should not throw RangeError
for length = NaN, undefined, negative number, floating point, and so on.
JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com