This patch is the second milestone of the implementation of this new language element.
Supported:
- Single class inheritance
- Functionality of 'super' keyword
- Implicit constructor in class heritage
- Specific behaviour while extending with the built-in 'Array' or '%TypedArray%' object
- Abstract subclasses (Mix-ins)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
The previous jerry_port interface did not allow timezones to be handled correctly,
even if the host system was up to the task. This PR changes the jerry_port interface
to allow a completely correct implementation to exist, and provides one (for Linux/BSD
systems) in default-date.c.
Fixes#1661
JerryScript-DCO-1.0-Signed-off-by: crazy2be crazy1be@gmail.com
There was an issue in the Promise implementation where properties were accessible from JavaScript.
ie. `Object.defineProperty(Object.prototype, 0, {})` could modify properties which should've been inaccessible.
The reason behind that is somewhat interesting as 0-7 were the same values as the enum values in the property list of the Promise object.
Changing these properties to internal, makes them inaccessible from JS side.
Also some tests have been changed, namely 2490 and 2465.
The 2490 one got renamed, and all of the testcases from the issue have been added.
2465 got changed as well, since currently our Promise implementation can't display Promise errors, so we should check if an error is correctly returned.
Fixes#2490
Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
If a new Capability was created no check was issued if it happened to be an error.
Fixes#2465Fixes#2468
Also fixes the second variant of #2490.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This fixes some conversion errors one gets when compiling with
LLVM/clang. Most of them are caused when a bit-specific type (i.e.
`uint16_t`) is implicitly cast to an `enum` of smaller value range.
The fix is just an explicit casting of those types to the desired target
type.
JerryScript-DCO-1.0-Signed-off-by: Martine Lenders m.lenders@fu-berlin.de
Clang 6 is more picky about implicit conversions and complains
about loss of presicion and/or change of signedness.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
`FILE_PATTERNS` is a space-separated list, in contrary to what is
suggested by its documentation. The pattern `*.h, *.c` does not
match header files but files with `.h,` extension only. Rewriting
the current comma-separated pattern makes Doxygen actually process
header files. However, it also reveals several hitherto hidden
issues (mostly missing documentation) in the code. This patch fixes
some of these documentation problems (and lists the files with
outstanding issues in a 'backlog').
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
There are some leftover global functions in the code that are not
referenced at all anymore. These functions are removed by this
patch.
There are also some global functions that are only used in their
own modules. These functions are made static by this patch.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
They are no big differences between the two forms as "" falls back
to <>. There are some inconsistencies in the code, though, which
are fixed by this patch.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This patch allows developers to set a typedarray given a source typedarray. This patch
attempts to follow section 22.2.3.22.2 in the ECMAScript spec as closely as possible.
JerryScript-DCO-1.0-Signed-off-by: AnthonyCalandra anthony@anthony-calandra.com
Indenting preprocessor directives reduces the code readability, because it make preprocessor directives harder to spot.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
`JERRY_UNREACHABLE`s often signal code structure that could be
improved: they can usually either be rewritten to `JERRY_ASSERT`s
or eliminated by restructuring loops, `if`s or `#if`s. Roughly,
the only valid occurences are in default cases of `switch`es. And
even they can often be merged into non-default cases.
Moreover, it is dangerous to write meaningful code after
`JERRY_UNREACHABLE` because it pretends as if there was a way to
recover from an impossible situation.
This patch rewrites/eliminates `JERRY_UNREACHABLE`s where possible
and removes misleading code from after them.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
A lot of warnings remained hibben because 'EXTRACT_ALL' was previously set to YES.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Some code paths explicitly used double instead of ecma_number_t
even though the values assigned from or compared to were of type
ecma_value_t.
Related to #2251
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The `args_length` variable in the `ecma_builtin_function_prototype_object_bind`
method is not needed, the `arguments_number` variable can be
directly used.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
There was a typo in the `ecma_builtin_array_prototype_helper_set_length`
method as the comma operator was used to close the statement, incorrectly
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
In general, public headers should not have compiler-specific
constructs but both the core and the port headers have attributes,
which are non-standard. It's better to factor out such constructs
to a common place (a new header) and hide them behind macros, which
can then be defined on a per-compiler basis.
This patch moves the existing definitions of function attributes and
likely/unlikely builtins to the new header. At the same time, it
unifies the names of these attribute defines and where they are
used. Moreover, it touches on jerry-main and removes the uses of
`__attribute__((unused))` entirely and replaces them with the
elsewhere used `(void) ...` pattern.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Moved the common preparation code for 'search' and 'match'
to a separate function.
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
Add line info data to byte, which allows getting a backtrace info directly
from the engine. Snapshots are not supported.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Their implementation only differs in the stop condition and the
final return value.
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
By removing the ECMA_TRY_CATCH macros at these
places ~200 bytes of .text is saved on rpi2.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com