1330 Commits

Author SHA1 Message Date
Zoltan Herczeg
562dcc8630
Fix Promise thenable. (#3799)
A single promise can be resolved any number of times due to
thenable functions, but each resolver pair can only be called once.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-28 10:48:44 +02:00
Dániel Bátyai
c2b6621702
Fix adding entries to the internal buffer of a Map object (#3805)
When appending the key/value pair separately, garbage collection could be
triggered before the value is added, which could cause problems during
marking. This patch changes insertion to add both values at the same
time, which prevents partial entries from being present in the internal
buffer.

Fixes #3804.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-28 07:55:16 +02:00
Szilagyi Adam
7a20150ae7
Fix error handling in Reflect.defineProperty (#3800)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-27 18:57:15 +02:00
Dániel Bátyai
8f76a1f382
Rework RegExp engine and add support for proper unicode matching (#3746)
This change includes several bugfixes, general improvements, and support
for additional features.
- Added full support for web compatibility syntax defined in Annex B
- Implemented parsing and matching patterns in unicode mode
- Fixed capture results when iterating with nested capturing groups
- Significantly reduced regexp bytecode size
- Reduced stack usage during regexp execution
- Improved matching performance

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-26 15:28:54 +02:00
Péter Gál
908240ba62
Improve property key query for Proxy objects (#3797)
Property key query for Proxy objects always returned all keys
even if no symbols were requested symbols were present in the
resulting array.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-26 15:22:49 +02:00
Dániel Bátyai
15629e8ba5
Add stack limit check to proxy operations (#3796)
Fixes #3785.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-26 09:44:38 +02:00
Robert Fancsik
3060656562
Fix lazy property listing for [[Enumerate]] (#3794)
This patch fixes #3784.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-25 19:09:12 +02:00
Szilagyi Adam
edaf4ef30f
Rework the Reflect.preventExtensions method (#3771)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-25 18:25:09 +02:00
Szilagyi Adam
843c542053
Rework the Reflect.setPrototypeOf method (#3774)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-25 18:24:04 +02:00
Szilagyi Adam
e50e2719df
Get the typedArray's length property properly in Array.prototype.concat (#3791)
We should use the "length" property instead of the internal arraybuffer's length

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-25 18:10:38 +02:00
Szilagyi Adam
ecf159795a
Rework the Reflect.defineProperty method (#3770)
Also a minor update to the FromPropertyDescriptor operation since in ES6 we can use a property
descriptor whitout any keys

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-25 18:09:37 +02:00
Zoltan Herczeg
1105b43c22
Optimize Promise data structures. (#3768)
This patch reworks several structures:

- Fulfill and reject reactions are combined into one collection. The values in this collection
are compressed: a capability followed by an optional fulfill and reject functions.
- Fulfill and reject reactions are directly stored, no need to allocate an object for them.
- The job queue directly stores its items, this saves a pointer to the value, and the
callback is replaced by an uint8 type.
- Promise status and already resolved is stored in extra_info.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-25 18:00:43 +02:00
Péter Gál
1774cca47c
Fix array length check in lastIndexOf (#3789)
When lastIndexOf is executed the array length can change and in
case of fast arrays the length should be re-checked.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-25 16:36:54 +02:00
Hyukwoo Park
589af6dc90
Handle properties of builtin routine separately from builtin objects (#3694)
separate builtin routine part to make code clear and to support 'name' property later

JerryScript-DCO-1.0-Signed-off-by: HyukWoo Park hyukwoo.park@samsung.com
2020-05-25 13:17:38 +02:00
Péter Gál
6fe6dab9cc
Fix parseFloat input string length calculation (#3782)
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-25 13:05:18 +02:00
Robert Fancsik
b2a2022d0a
Fix property order in lazy property listing for builtin/external functions (#3780)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-25 13:00:21 +02:00
Szilagyi Adam
f06c533a29
Change the Reflect.ownKeys method's length property (#3775)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-25 12:59:51 +02:00
Robert Fancsik
b9258da7d0
Accessor functions should not have 'prototype' property (#3781)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-25 12:57:25 +02:00
Robert Fancsik
6cd309b525
Function.prototype[@@hasInstance] should not throw error for not callable this value (#3773)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-22 17:23:07 +02:00
Rafal Walczyna
876622a061
Fix vera++ rule to find expressions without space after parentheses (#3776)
Regex didn't include some characters that may occur after ')'

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-05-22 14:37:59 +02:00
Péter Gál
87b1d1eeb0
Fix regexp flag handling in case of regexp like object (#3766)
The regexp flag should be correctly referenced and released
if an existing regexp like object is used for constructing a new one.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-21 14:51:50 +02:00
Péter Gál
08222992dc
Fix parseFloat for non-infinity values (#3769)
The parseFloat method performed the "Infinity" string check
incorrectly.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-21 14:50:59 +02:00
Szilagyi Adam
e1960621f3
Add new target support to RegExp object (#3723)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-20 17:10:55 +02:00
Péter Gál
bbb5c9180e
Fix releasing the pattern string in regexp (#3765)
The release of the regexp pattern string during creating
was incorrect as it was dereferenced a bit to early.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-20 12:10:05 +02:00
Dániel Bátyai
378244942f
Fix iterator closing in Promise all/race (#3759)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-18 21:22:08 +02:00
Dániel Bátyai
7274fa4dd4
Fix rounding in Number.prototype.toFixed (#3747)
Fixes #3741.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-18 18:39:00 +02:00
kisbg
a6f6bce6f0
Added new target support for Date Object (#3739)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-05-15 22:21:40 +02:00
Mátyás Mustoha
f13e8b602e
Fix position calculations of String.startsWith (#3734)
Fixes two bugs in the index calculations that affect the result
of the `String.startsWith` function:

- Fixes the implementation of ECMA-262 v6, 21.1.3.18, step 14:
  "If searchLength+start is greater than len, return false".
- Fixes the return value of the helper function
  `ecma_builtin_helper_string_find_index`. If it is called with a
  starting search position, the returned index should be
  not less than that.

These changes fix the following test cases in the test262 suite:

- built-ins/String/prototype/startsWith/return-true-if-searchstring-is-empty.js
- built-ins/String/prototype/startsWith/searchstring-found-with-position.js

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2020-05-15 22:18:42 +02:00
Daniella Barsony
b51157d3c5
Add Array new target support (#3728)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-05-15 16:36:06 +02:00
Szilagyi Adam
95aa827635
Fix value release in ecma_builtin_regexp_dispatch_helper (#3702)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-14 17:10:27 +02:00
Robert Fancsik
9ad9d574fe
Add proxy support for HasBinding operation for Object Environment records (#3731)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-13 14:27:31 +02:00
Robert Fancsik
df7e303145
Fix apply receiver operation for Proxy objects (#3730)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-11 16:56:41 +02:00
Szilagyi Adam
050fbfc130
Add Proxy support for JSON.stringify (#3685)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-11 15:18:18 +02:00
Szilagyi Adam
094ba2f30a
Update the Array.prototype.reverse method to support ES6 version (#3676)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-11 13:42:46 +02:00
Szilagyi Adam
97a35b0f10
Add new target support to Function object (#3708)
Added steps 1, 2.c, 3.c, 21, 22 to ecma_op_create_dynamic_function

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-11 13:40:50 +02:00
Rafal Walczyna
aa1777b1a0
Update ES6 Regexp accessors descriptors (#3726)
In ES6 accessors of built in object are by default configurable.
Also lastIndex property of RegExp object is created when only used.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-05-08 12:25:45 +02:00
Péter Gál
18fe546802
Fix appending elements for ecma collection (#3719)
During ecma_collection_append the underlying collection
was not increased in the required case. This triggered
a buffer overflow when processing the bound function's arguments
during call or during the Proxy ownKeys method.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-07 16:11:14 +02:00
Péter Gál
90c7eccb42
Fix fast array handling when doing put with receiver (#3720)
During "put" with receiver the fast arrays were not converted to normal
objects to correctly set properties on it.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-07 09:00:50 +02:00
Rafal Walczyna
99859fb221
Fix prototype of NativeError objects (#3716)
Internal property [[Prototype]] of EvalError, RangeError, ReferenceError,
SyntaxError, TypeError and URIError should be Error.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-05-07 08:58:42 +02:00
Mátyás Mustoha
5af751263b
Remove the unused ecma_op_check_object_type_is_class declaration (#3718)
Removes the unused `ecma_op_check_object_type_is_class` function
declaration from `ecma-helpers.h`. This also makes the file pass
the Doxygen check.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2020-05-07 08:56:31 +02:00
Szilagyi Adam
409e1fec5f
Add missing index incrementation to ecma_builtin_string_object_raw (#3709)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-04 15:08:14 +02:00
kisbg
8ccb95c31c
Added new target support to Promise (#3707)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-05-04 15:03:12 +02:00
kisbg
14cea9c1ec
Added new target support in Map, WeakMap, Set and WeakSet (#3701)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-05-04 14:24:39 +02:00
Szilagyi Adam
b5d9699788
Update the RegExp.prototype.test function to support ES6 version (#3693)
The algorithm is based on ECMA-262 v6, 21.2.5.13

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-04 14:10:56 +02:00
Szilagyi Adam
1a72e070c8
Add value/key sign swap for Set.add and Map.set methods (#3681)
See also: ECMA-262 v6, 23.2.3.1 step 6 and 23.1.3.9 step 6

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-04 14:00:36 +02:00
Daniella Barsony
6ff299c831
Add [[GetOwnProperty]] internal Proxy method (#3672)
Depends on #3662

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-04-30 15:51:23 +02:00
Zoltan Herczeg
4b780507e1
Implement throwing const re-assignment error. (#3697)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-29 15:50:22 +02:00
Szilagyi Adam
2bdd0f5008
Accessor functions do not have [[Construct]] internal method (#3698)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-04-29 13:04:57 +02:00
Szilagyi Adam
62730f2ae1
Implement Proxy object [[DefineOwnProperty]] internal method (#3662)
The algorithm is based on ECMA-262 v6, 9.5.6

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-04-28 09:51:01 +02:00
Zoltan Herczeg
4e8dac8ce1
Implement exponentiation operation. (#3692)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-27 11:43:35 +02:00