643 Commits

Author SHA1 Message Date
Csaba Osztrogonác
72f8ef344c
Implement missing Math functions from ES6 standard (#3593)
First step to fix issue #3568.

Changes:
- Implemented Math.clz32(), Math.fround(), Math.imul(), Math.hypot().
- Implemented all remaining Math functions with calling the standard
libm functions, but they throw UNIMPLEMENTED exception with jerry-libm,
because the necessary fdlibm functions are missing and should be ported.

All Math related test262 tests pass (except function name and length tests)

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-03-10 11:15:00 +01:00
Szilagyi Adam
76bbb088e9
Optimize Array.prototype.fill for fast-array cases (#3569)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-03-03 15:48:50 +01:00
Szilagyi Adam
aa17a4fa5d
Implement ecma_stringbuilder_create_raw method for stringbuilder (#3584)
With this new method, we can create a stringbuilder from a raw string

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-03-02 15:39:12 +01:00
Szilagyi Adam
a6acf2d417
Fix value release in ecma_builtin_array_prototype_object_copy_within (#3583)
Fixes #3580

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-03-02 10:28:02 +01:00
Robert Fancsik
4e136c8973
Implement the core of Proxy object (#3562)
- Internal routines of the of the proxy object are unimplemented
 - For-in enumerate with proxy target is currently not supported

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-02-28 14:41:59 +01:00
Rafal Walczyna
20300189cb
Fix Symbol properties descriptors. (#3581)
Symbol properites descriptors had invalid values

Fixes #3578

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-02-24 14:06:14 +01:00
Szilagyi Adam
cdbabc8c30
Use stringbuilder in ecma_builtin_try_to_instantiate_property (#3575)
Also removed the ecma_append_magic_string_to_string method,
because it doesn't get used anymore.

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-02-24 11:19:04 +01:00
Szilagyi Adam
acbdb4184f
Use stringbuilder in ecma_builtin_typedarray_prototype_join (#3573)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-02-24 11:15:36 +01:00
Daniella Barsony
73daeb19c9
Implement new Reflect methods (#3549)
This patch implements the get, set, has, deleteProperty, ownKeys, and construct methods of the Reflect objects. The Reflect.construct method is missing the new_target support because ecma_op_function_construct doesn't support it yet.

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-02-24 11:02:06 +01:00
rwalczyna
0ff664cab6
Fix Array.find and Array.findIndex omitting empty values. (#3563)
Empty values in array were omitted. Predicate should be called
for every element from 0 to length.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-02-18 15:19:53 +01:00
Szilagyi Adam
181570ff41
Implement EscapeRegExpPattern method (#3543)
the algorithm is based on ECMA-262 v6, 21.2.3.2.4

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-02-18 09:49:54 +01:00
Hyukwoo Park
54e4de39ab
Fix attributes of length property for builtin objects (#3556)
* length property has the attributes {[[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true} based on ECMA-262 v6, 19.2.4.1

JerryScript-DCO-1.0-Signed-off-by: HyukWoo Park hyukwoo.park@samsung.com
2020-02-14 10:25:26 +01:00
Szilagyi Adam
4d67ac3225
Use stringbuilder in ecma_builtin_string_prototype_object_concat (#3557)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-02-13 17:42:07 +01:00
Szilagyi Adam
8cd5d06620
Update ecma_op_typedarray_from to use iterable objects (#3501)
Added steps 6-8 from ECMA-262 v6, 22.2.2.1.1

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-02-13 15:53:41 +01:00
Dániel Bátyai
a78c8d4f16
Add vera rules to check consecutive and trailing empty lines (#3540)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-02-03 16:39:04 +01:00
Robert Fancsik
b73100d933
Add missing release value call to Array.prototype.pop fast path. (#3535)
This patch fixes #3534.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-24 10:54:55 +01:00
Robert Fancsik
3c5fb342be
Update "arguments" and "caller" properties of function object to conform ES6 changes (#3530)
This patch resolves #3393.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-23 15:53:37 +01:00
Peter Marki
51244b6d08 Add option to list symbols in Object.getOwnPropertyNames() (#3507)
Also a little refactoring of Object.getOwnPropertyNames()

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-01-16 15:59:27 +01:00
Robert Fancsik
8b41bf306a
Introduce builtin intrinsic object to share property values between builtin objects (#3490)
Fixed:
 - Global symbol access
 - Array.prototype.values and Array.prototype[Symbol.iterator] must be the same function object

To test the new functionality arguments object Symbol.iterator property is added.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-16 15:57:27 +01:00
Robert Fancsik
4a331b2edc
Add builtin GeneratorFunction support (#3499)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-15 12:01:58 +01:00
Robert Fancsik
be83ff6b71 Update Function.prototype.bind to conform ES6 requirements (#3504)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-13 11:43:11 +01:00
Daniel Balla
1725e014b8 Support iterable objects in Promise.all and Promise.race functions (#3496)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-01-10 15:44:52 +01:00
Szilagyi Adam
c407e8a04c Refactor ecma_builtin_error_prototype_object_to_string to use stringbuilder (#3503)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-01-10 15:40:00 +01:00
Peter Marki
08da8bc7aa Add length check to ecma_builtin_array_prototype_object_slice (#3481)
Fixes #3479

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-01-10 12:16:53 +01:00
Szilagyi Adam
22e52e45af Fix value release in ecma_builtin_typedarray_prototype_map (#3491)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-01-07 14:25:59 +01:00
Csaba Osztrogonác
9e0709e401 Fix Array.prototype.reduce and reduceRight (#3487)
Don't throw TypeError when object length is 0 and initialValue is undefined.
Additionally the error message should be more precise and match other engines.

Fixes #3463

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-01-06 15:17:54 +01:00
Szilagyi Adam
40b38f70ef Refactor ecma_regexp_exec_helper arguments (#3484)
We use pointers instead of ecma_value_t

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-01-06 14:38:09 +01:00
Peter Marki
300570381f Add fast-path check to ecma_builtin_array_prototype_slice (#3480)
Fixes #3459

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-01-06 10:30:10 +01:00
Daniel Balla
e21e4a18ba Fix freeing this_arg in ecma_builtin_promise_race_or_all (#3482)
Fixes #3478

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-01-03 14:18:40 +01:00
Zoltan Herczeg
8cb2be6001
Support parsing async modifiers for functions. (#3460)
Only parsing is implemented, so the async functions currently behave
like normal function except they return with a resolved Promise object
when the function is terminated correctly.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-20 09:55:41 +01:00
Dániel Bátyai
2a29b72a83 Implement and add support for Symbol.split (#3453)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-12-20 09:10:58 +01:00
Csaba Osztrogonác
85bb2113fe Make Math.min() and Math.max() ECMA262 conform (#3465)
Math.min() and Math.max() functions should apply ToNumber on each arguments
always, even if a NaN argument occured previously and the result will be NaN.

ECMA262 v5.1 15.8.2:
"Each of the following Math object functions applies the ToNumber abstract
operator to each of its arguments (in left-to-right order if there is more
than one) and then performs a computation on the resulting Number value(s).

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-12-20 08:57:17 +01:00
Robert Fancsik
9596a7e1d6
Implement tagged template literals (#3456)
Missing features: snapshot support

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-19 19:10:45 +01:00
Szilagyi Adam
7bfbc701d8 Implement Symbol.unscopables (#3405)
Added a new property for Array.prototype based on ECMA-262 v6, 22.1.3.31
Also upgraded the HasBinding operation with ECMA-262 v6, 8.1.1.2.1 steps 7-9

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-19 16:34:23 +01:00
Daniel Balla
e0d8c4ca10 Add @@species accessor to Array and Promise builtin objects (#3440)
Fully support @@species and SpeciesConstructor in Array and Promise builtins.
Also added partial support to TypedArrays, but a rework is needed in %TypedArray%.prototype functions' typedarray constructor, which is out of this patch's scope.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-12-16 11:44:15 +01:00
Zoltan Herczeg
40d930d62c Implement \u{hex} support. (#3447)
A large rework because surrogate pairs must be combined.

Currently only the 0x10C80..0x10CF2 is accepted as valid identifier character from the non-basic plane.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-16 11:26:02 +01:00
Csaba Osztrogonác
1db16c3a1c Fix Math.round(x) for big integer numbers (#3449)
Math.round(x) should be x it x is already integer. (ES5 15.8.2.15)
The current implementation calculates with x +/- 0.5, which isn't
representable numbers if x >= 2^52.

A correct bug fix can be to follow the spec and simply
return the number itself if it is already integer.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-12-16 10:57:22 +01:00
Dániel Bátyai
d3b8bed2c1 Implement and add support for RegExp.prototype[@@search] (#3436)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-12-12 15:59:28 +01:00
Csaba Osztrogonác
fb4b18a515 Fix Math.trunc(x) if -1 < x < 0 (#3445)
Math.trunc(x) should be -0.0 if -1 < x < 0 (ES2015 20.2.2.35). The problem
was that -0 isn't -0.0, but +0.0 in C. There were a test case for it, but
it was incorrect, because +0.0 === -0.0 in JS.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-12-12 10:57:44 +01:00
Robert Fancsik
9b33fc8cbd Revise the usage of the global error value/exception flag (#3426)
This patch also fixes #3422.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-10 14:42:10 +01:00
Szilagyi Adam
7c0b1ca88a Update String.prototype.match to ECMA-262 v6 (#3375)
The algorithm is based on ECMA-262 v6, 21.1.3.11

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-10 14:40:41 +01:00
Szilagyi Adam
6cc9848afc Implement Array.of method (#3418)
The algorithm is based on ECMA-262 v6, 22.1.2.3

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-10 14:30:59 +01:00
Szilagyi Adam
dc458d29fb Implement TypedArray.of method (#3428)
The algorithm is based on ECMA-262 v6, 22.2.2.2

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-09 14:19:40 +01:00
Daniella Barsony
89db9253c8 Refactor code to use ToInteger (#3224)
Fixes #3325
Fixes #3237

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-12-09 12:07:25 +01:00
Szilagyi Adam
e70cfed57a Add bounds check for copyWithin (#3425)
When inputs are out of bounds, we don't need to do anything in the operation.

Fixes #3408

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-06 13:33:41 +01:00
Robert Fancsik
99fa823bab Fix cleanup on error in Array.from (#3423)
This patch fixes #3420.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-05 20:24:37 +01:00
Zoltan Herczeg
1a4972fc3f Implement yield* operation in generator functions. (#3407)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-05 13:50:53 +01:00
Roland Takacs
67d677a1bc Implement ArrayBuffer.isView function (#3403)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs r.takacs2@partner.samsung.com
2019-12-04 15:36:42 +01:00
Robert Fancsik
59eb0787ba Fix global error management in ecma_builtin_string_prototype_object_split (#3414)
This patch fixes #3395.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-04 14:13:43 +01:00
Robert Fancsik
bfc495f0cb Implement Array.from routine (#3402)
The patch also revealed a minor issue about Map[Symbol.iterator] which have been fixed as well.

Co-authored-by: Daniella Barsony bella@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-03 15:39:11 +01:00