3912 Commits

Author SHA1 Message Date
Péter Gál
c8d15ddbf7
Date.protoype.toJSON should look for toISOString once (#3996)
The toJSON method should be searched on the `this` object
only once. In case of normal objects there were no problems
however when a Proxy object is used as the `this` argument
for the Date.prototype.toJSON method the Proxy's `get` method
was invoked twice.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-15 17:12:55 +02:00
Roland Takacs
8fdbc6a85b
Implement Object.{entries, values} built-in methods (#3993)
Object.keys also updated to follow the ES11 standard.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
2020-07-14 15:59:40 +02:00
Szilagyi Adam
9dbbcab49d
Remove ecma_op_object_get_own_data_prop and use ecma_op_object_get_by_magic_id instead (#3969)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-13 12:12:46 +02:00
Mátyás Mustoha
870a3d3ffb
Update the NuttX-STM32 documentation (#3986)
Fixed and updated some of the repository locations and the
relevant build commands.

- Updating `stlink` fixes a CMake build error on the 1.5.1 branch
- Updating the `kconfig` build command allows creating `kconfig-tweak`,
  which fixes a warning during the NuttX configuration

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2020-07-10 16:09:13 +02:00
Robert Fancsik
37906baa25
Rework promise internal structures (#3985)
- Capabilities
- Promise all resolver

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-10 16:08:34 +02:00
Szilagyi Adam
dfabfe7a56
Add missing isArray checks based on the ES11 standard (#3983)
Added checks to the following methods:
- ecma_builtin_json_stringify, ECMA-262 v11, 24.5.2
- ecma_builtin_json_internalize_property, ECMA-262 v11, 24.5.1.1

Fixes #3945
Fixes #3950

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-10 16:06:27 +02:00
Robert Fancsik
b90fa63255
LEXER_ASSIGN_GROUP_EXPR should not be emitted when parsing LHS expression (#3990)
This patch fixes #3935.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-10 08:35:33 +02:00
Roland Takacs
35e1e98008
Fix Object.assign to call [[GetOwnProperty]] Proxy handler only once (#3988)
Removed the enumerable option when listing properties to prevent an extra
[[GetOwnProperty]] function call for Proxy objects.
In this case all the property names are collected, but the Object.assign()
implementation has already taken care of the enumerable property filtering.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
2020-07-09 10:23:43 +02:00
Péter Gál
ae5cfae3e7
Implement ToPropertyKey operation (#3966)
From ES 6 the ToPropertyKey operation is used to convert elements to a valid property key.
This "new" method uses the ToPrimitive operation which can call the `@@ToPrimitive`
well-known symbol to convert the given element to a key.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-06 15:17:18 +02:00
Csaba Osztrogonác
ed9e3eccf9
Make Date constructor conform to the latest spec (#3972)
Date constructor called with 1 argument should accept Date objects too.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-06 14:47:10 +02:00
Robert Fancsik
c1e90da0b4
Support Unicode supplementary planes (#3928)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-06 14:21:13 +02:00
László Langó
7353b253ab
Fixed memory leak in %TypedArray%.prototype object's 'sort' routine. (#3981)
The buffer of values were not freed properly when an exception was
thrown in the compare function.

Fixes #3975

JerryScript-DCO-1.0-Signed-off-by: László Langó lango@inf.u-szeged.hu
2020-07-06 13:42:27 +02:00
Csaba Osztrogonác
b6183baf84
Fix tools/runners/run-test-suite.py with Python 3.6 (#3982)
text parameter of Popen introduced in Python 3.7,
we should use the equivalent universal_newlines.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-06 13:38:50 +02:00
Szilagyi Adam
69f917650e
Update parser early return type in ESNEXT (#3742)
This patch updates the early return types in the parser to SyntaxError instead of ReferenceError
in ESNEXT

This patch also includes a lot of tests for LeftHandSideExpression validation when using the = operator

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-06 13:36:28 +02:00
Szilagyi Adam
97fc48132a
Use the Invoke method where the ES10 standard says (#3963)
We can apply this change to methods which use older standards, because
of the backward compatibility the result is the same

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-06 09:05:04 +02:00
Csaba Osztrogonác
5f951bb4f1
Fix TimeWithinDay(t) abstract operation (#3974)
Fixes #3973.

TimeWithinDay(t) = t modulo msPerDay, where msPerDay = 86400000.
The sign of the modulo operation result should be same as the right side
per definition, conseqently TimeWithinDay(t) >= 0.

References:
- https://www.ecma-international.org/ecma-262/11.0/#sec-mathematical-operations
- https://www.ecma-international.org/ecma-262/11.0/#sec-overview-of-date-objects-and-definitions-of-abstract-operations

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-06 08:12:07 +02:00
Szilagyi Adam
392ee71712
Remove ECMA_TRY_CATCH macro (#3829)
also refactored the touched methods a little bit

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-03 15:06:49 +02:00
Robert Fancsik
19ecd8717f
Fix property redefinition (#3970)
The previously allocated property should not be deleted only it's type should be change.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-03 14:13:47 +02:00
Robert Fancsik
f98d7f24a7
Support super property reference in object methods/accessors (#3940)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-03 12:16:23 +02:00
Zoltan Herczeg
80716cca90
Implement missing async function and async iterator prototypes. (#3962)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-07-03 11:04:27 +02:00
Zsolt Borbély
f86b78a886
Fix the configuration of stack measurement in jerry-test (#3971)
Build command via CMake parameter:
```
tools/build.py --jerry-cmdline-test=on --cmake-param=-DJERRY_TEST_STACK_MEASURE=ON --compile-flag=-static
```

Build command via compile flag:
```
tools/build.py --jerry-cmdline-test=on --compile-flag=-DJERRY_TEST_STACK_MEASURE=1 --compile-flag=-static
```

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2020-07-02 17:12:13 +02:00
Zoltan Herczeg
9e18ff29c6
Implement ... support for object initializers. (#3968)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-07-02 15:04:21 +02:00
Péter Gál
eb77f96d20
Add simple stack measure for jerry-test (#3717)
This change introduces simple stack measuring by coloring the stack
before doing the actual JS work.

The dynamic linking should be avoided as it will use the stack during
the symbol resolving.

At this moment the `JERRY_STACK_MEASURE` compile time define will enable
the measurement for the jerry-test binary.

A usable build configuration:

```
./tools/build.py --jerry-cmdline-test=on --compile-flag=-DJERRY_STACK_MEASURE=1 --compile-flag=-static
```

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-02 11:54:52 +02:00
Szilagyi Adam
cd1e067671
Update Promise.race and Promise.all to ES11 (#3954)
Changes based on ECMA-262 v11, 25.6.4.4 and 26.6.4.1 step 3

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-02 11:46:07 +02:00
Péter Gál
55d6637da5
Fix Date.prototype[@@toPrimitive] hint handling (#3967)
The Date.prototype[@@toPrimitive] only allows the "string", "default" and "number"
hint values. Any other value should throw a TypeError.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-02 11:40:08 +02:00
Csaba Osztrogonác
e943d12286
Speedup AppVeyor CI runtime (#3965)
There is no good reason to test JERRY_DEBUGGER=OFF configuration too,
because debugger itself contains Windows specific codepath. If the
build works with debugger, it has to work without debugger too.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-01 19:51:58 +02:00
Péter Gál
0c61aee597
Improve the JSON C API (#3943)
* Added more details into documentation.
* Moved the C unit-test into its own file.
* Added extra test cases.
* Extended the API reference documentation with doctests.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-01 14:50:39 +02:00
Péter Gál
ca12a8f8f4
Fix JSON.stringify empty array replacer handling (#3938)
In case of an empty array is used as a replacer for the JSON.stringify,
the output string should not contain any keys.

Fixes: #3926

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-01 12:41:34 +02:00
Zoltan Herczeg
6389816f67
Implement AsyncIteratorClose for for-await-of statement. (#3955)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-07-01 12:40:39 +02:00
Roland Takacs
dc3165533e
Support symbol property names in Object.defineProperties (#3933)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
2020-07-01 12:38:20 +02:00
Csaba Osztrogonác
0deeb39ebf
Fix Object.prototype.toLocaleString() and Array.prototype.toLocaleString() (#3953)
Since ES6 Object.prototype.toLocaleString() shouldn't call ToObject() and
Array.prototype.toLocaleString() shouldn't call ToObject() for each element.
References:
- https://www.ecma-international.org/ecma-262/11.0/index.html#sec-array.prototype.tolocalestring
- https://www.ecma-international.org/ecma-262/11.0/index.html#sec-object.prototype.tolocalestring

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-01 12:05:54 +02:00
Csaba Osztrogonác
1064b19cfb
Class accessors shouldn't be enumerable. (#3961)
Reference:
https://www.ecma-international.org/ecma-262/11.0/index.html#sec-runtime-semantics-classdefinitionevaluation 21.a,b

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-01 12:03:49 +02:00
Csaba Osztrogonác
b57e9cbc27
Symbol.prototype[Symbol.toPrimitive].length should be 1 (#3960)
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-07-01 08:54:58 +02:00
Zoltan Herczeg
37049c4968
Support catch statement without argument. (#3956)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-30 18:00:40 +02:00
Rafal Walczyna
9d2b7334bc
Update Symbol.split functions for String and Regexp to match new standard (#3942)
In newest ES standard limit parameter is calculated using
ToUint32 function instead of ToLength.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-06-30 16:03:11 +02:00
Mátyás Mustoha
3e866258db
Update NuttX to 9.0 on Travis (#3958)
Update the Travis builds to use NuttX 9.0, which was
released on April 26, 2020.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2020-06-30 15:53:29 +02:00
Ruzsinszki Gábor
ed6689ab8f
Adds support for compiling with MSYS and MINGW under windows (#3949)
JerryScript-DCO-1.0-Signed-off-by: Ruzsinszki Gábor ruzsinszki.gabor@gmail.com
2020-06-30 14:07:08 +02:00
Zoltan Herczeg
cd949d9d64
Rework flags representing arrow functions and complex arguments (#3957)
This allows detecting cases which was not possible before.

Fixes #3944

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-30 14:00:35 +02:00
Csaba Osztrogonác
122480aa61
JERRY_BUILTIN_xxx macros should depend on JERRY_ESNEXT (#3920)
JERRY_BUILTIN_xxx (ES2015+) features don't build without enabling
JERRY_ESNEXT macro, this invalid configuration shouldn't be allowed.
Additionally remove unnecessary JERRY_ESNEXT ifdef guards.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-06-30 13:54:50 +02:00
Szilagyi Adam
c0b594fa69
Remove duplicate is_object check when calling ecma_op_to_primtive (#3899)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-06-30 13:18:40 +02:00
Roland Takacs
034b3b63f5
Correct Object.keys to collect only enumerable property names (#3952)
In case of Proxy objects, there were no property descriptor checks when
collecting enumerable properties. Therefore, all the non-enumerable
Proxy.target properties were listed as well.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
2020-06-30 13:13:18 +02:00
Csaba Osztrogonác
89342ea503
Make test262-es2015 output more verbose (#3924)
It makes easier to debug unexpected failures on the CI.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-06-30 12:47:54 +02:00
Zoltan Herczeg
5535ea88ac
Implement for-await-of statement. (#3946)
AsyncIteratorClose has not supported yet.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-30 11:21:50 +02:00
Zoltan Herczeg
0b404ea893
Support caching of next method in for-of and built-in methods. (#3939)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-26 14:47:39 +02:00
Csaba Osztrogonác
264bb210c1
Fix profile file parsing in CMake (#3932)
Changes:
- Comment can be started anywhere, not only at the beginning of the input.
- The end of the comment isn't the end of the input, but the first newline.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-06-26 13:46:08 +02:00
Dániel Bátyai
2523323310
Simplify resource name handling (#3929)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-06-26 12:10:14 +02:00
Zoltan Herczeg
b7e3baeecb
Support caching of next method in generators. (#3937)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-26 12:09:36 +02:00
Zoltan Herczeg
f88489beef
Implement yield* operator (#3923)
Missing features:
- caching next() method (this also true for normal generators)
- automatic sync to async generator conversion

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-25 17:11:16 +02:00
Péter Gál
c12c60c550
Fix DataView argument handling in case of undefined value (#3930)
The DataView's third argument incorrectly processed the "undefined"
value resulting in a RangeError.

Fixes: #3927

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-06-25 14:05:08 +02:00
Roland Takacs
ae17c1184c
Implement Object.getOwnPropertyDescriptors built-in method (#3921)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
2020-06-25 12:08:46 +02:00