872 Commits

Author SHA1 Message Date
Robert Fancsik
924f4bbd74 Fix the order of value finalizing in ecma_builtin_typedarray_prototype_join (#2726)
This patch fixes #2724.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-25 11:03:11 +01:00
Robert Fancsik
7ed7935084 Add missing ecma_deref_ecma_string call to ecma_builtin_json_object (#2720)
This patch fixes #2719.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-22 01:26:34 +01:00
Roland Takacs
0b3d5edc06 Fix some type conversions in ecma-builtins. (#2706)
Added missing parentheses and explicit type conversions.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
2019-01-17 12:50:16 +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
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
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
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
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
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
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
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
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
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
e11c499b4b Reduce ecma_{ref, deref}_object calls while using ecma_builtin_get (#2616)
The following stucture was highly frequented in the code base:

 - Get a builtin object // This operation increases the reference count of the object
 - Use it for create a new object
 - Deref the builtin object

After a builtin has been instantiated there is always at least one reference to "keep it alive",
so increase/decrease the reference count for getting the value only is unnecessary.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-28 20:23:21 +01:00
Robert Fancsik
49a0836daa Add missing ecma_free_value in ecma_builtin_promise_do_all (#2604)
This patch fixes #2602 and fixes #2603 as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-20 14:40:34 +01:00
Daniel Balla
704eb45cb8 [API] Add RegExp C API (#2542)
This patch supports creating a RegExp object through the C API.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-11-19 13:18:00 +01:00
Robert Fancsik
9535a230ba Reduce the argument count of ecma_op_object_get_property_names (#2598)
Introduce ECMA_LIST_ARRAY_INDICES[_ENUMBERABLE[_PROTOTYPE]] flags instead of passing 3 boolean arguments.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-15 13:40:44 +01:00
Robert Fancsik
3faec79071 Reduce ecma_builtin_helper_def_prop arguments (#2585)
This patch uses the ECMA_PROPERTY_CONFIGURABLE[_ENUMERABLE_[WRITABLE]] marco to pass the options instead of using 3 boolean arguments for it.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-06 18:13:38 +01:00
Akos Kiss
aeddb1cd88
Get rid of ? true : false (#2575)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-10-29 14:51:59 +01:00
Robert Fancsik
d1860d0e34 Implement ES2015 class feature (part II.) (#2439)
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
2018-10-25 16:00:48 +02:00
crazy2be
3afc4b0b85 Change jerry_port interface to allow for a correct implementation of timezones. (#2540)
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
2018-10-18 00:58:18 +02:00
Robert Fancsik
abf22597e5 Add missing error check in ecma_builtin_promise_do_race (#2546)
Fixes #2544.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-10-03 11:39:43 +02:00
Daniel Balla
7717d2ee27 Change Promise properties to internal properties (#2526)
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
2018-09-24 13:49:41 +02:00
Robert Fancsik
685d8b3675 Fix JERRY_CONTEXT (error_value) handling during ecma_builtin_promise_reject_abrupt (#2519)
Fixes #2489.

Co-authored-by: Daniel Balla <dballa@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-09-17 18:27:00 +02:00
Peter Marki
0d05dfcd68 Remove bad assertion in ecma_builtin_json_str_helper (#2521)
Fixes #2494

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2018-09-14 12:04:47 +02:00
Daniel Balla
8f64339e5f Fix ecma_op_object_put return value not being handled (#2514)
Fixes #2487
Fixes #2488

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-09-06 21:05:37 +02:00
Zoltan Herczeg
d3d42f7685 Implement the core of the map object. (#2447)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-09-04 13:30:00 +02:00
Daniel Balla
f5757e4c91 Fix ecma_builtin_promise_race_or_all function (#2491)
If a new Capability was created no check was issued if it happened to be an error.
Fixes #2465
Fixes #2468
Also fixes the second variant of #2490.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-08-31 16:45:32 +02:00
Anthony Calandra
b2cf7eb659 Add %TypedArray%.prototype.sort([ compareFunction ]) support. (#2437)
JerryScript-DCO-1.0-Signed-off-by: Anthony Calandra anthony@anthony-calandra.com
2018-08-22 08:49:12 +02:00
Martine Lenders
851f4f0b89 Fix LLVM/clang conversion errors (#2473)
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
2018-08-21 08:22:57 +02:00
Akos Kiss
b31e43075a Add explicit casts to enum-to-integer conversions (#2467)
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
2018-08-13 13:01:37 +09:00
Akos Kiss
79d1a3cc7e Fix FILE_PATTERNS of Doxyfile and some of the issues it was hiding (#2446)
`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
2018-08-13 12:42:19 +09:00
Akos Kiss
fb35e34801 Make string constants const char * const (#2458)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-08-10 21:08:49 +02:00
Akos Kiss
58c568a68f Revisit unused global functions in jerry-core (#2450)
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
2018-08-08 23:34:13 +09:00
Akos Kiss
2534d32339 Use #include<> for system headers and #include"" for own headers (#2445)
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
2018-08-06 18:00:49 +02:00
Daniel Balla
87897849f6 Fix for null pointer dereference in jmem_heap_free_block (#2440)
Fixes #2435.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-08-01 23:09:30 +09:00
Robert Fancsik
77d9314b1d Simplify source evaluation options. (#2431)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-07-20 08:50:39 +02:00
Zoltan Herczeg
04dcefe087 Rework function call. (#2414)
Furthermore add a construct flag, which disallows calling certain
functions without new. Constructing bound arrow functions correctly
throws error now.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-07-11 09:35:44 +09:00
Anthony Calandra
50daa39ee8 Optimize JSON Quote operation. (#2420)
JerryScript-DCO-1.0-Signed-off-by: Anthony Calandra anthony@anthony-calandra.com
2018-07-10 15:00:19 +02:00
Anthony Calandra
a456c90c1d Add %TypedArray%.prototype.fill(value, [ begin [, end ] ]) support. (#2415)
JerryScript-DCO-1.0-Signed-off-by: Anthony Calandra anthony@anthony-calandra.com
2018-07-03 19:21:14 +09:00
Anthony Calandra
d5cd32b0c0 Support for %TypedArray%.prototype.set(typedArray [, offset]). (#2405)
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
2018-07-03 15:19:53 +09:00
Anthony Calandra
a74bf7dc91 Add %TypedArray%.prototype.subarray([ begin [, end ] ]) support. (#2410)
JerryScript-DCO-1.0-Signed-off-by: Anthony Calandra anthony@anthony-calandra.com
2018-06-28 09:41:07 +02:00
Mátyás Mustoha
bc827cb497 Reduce code duplication between String.charAt and charCodeAt (#2331)
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-06-14 17:48:25 +09:00
László Langó
be59d0a224 Remove the indentation of preprocessor directives. (#2379)
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
2018-06-08 15:35:23 +09:00
László Langó
b4b0b7d572 Merged conditions of if statements where possible. (#2380)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-06-06 15:08:17 +09:00
Akos Kiss
4779451284
Cleanup code around JERRY_UNREACHABLEs (#2342)
`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
2018-05-25 07:27:30 +02:00
Yonggang Luo
872825fb57 Add Windows support. (#2306)
JerryScript-DCO-1.0-Signed-off-by: PKarics karicska@gmail.com
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2018-05-18 19:42:14 +09:00
László Langó
64b16bf190 Update Doxygen config file and fix Doxygen warnings (#2324)
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
2018-05-18 15:43:17 +09:00