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
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
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
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
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
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
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
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
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
New method uses length of source to calculate raw string length.
Also bug with template literal was fixed. Template object should have
indexed properties enumerable.
JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
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
Template literals already supports escaping backslash and backtick,
this commit enables escaping this in String.raw.
It also fixes invalid behaviour of String.raw when using
new line character.
JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
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
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
After the rework it is possible to detect use before init errors for function arguments.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
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
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