678 Commits

Author SHA1 Message Date
Zoltan Herczeg
640a7d33b3
Support byte code dump when snapshot is executed. (#4327)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-11-16 12:17:41 +01:00
Peter Marki
25bb5083be
Fix await parsing in modules (#4266)
Fixes #4189

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-11-10 09:53:00 +01:00
kisbg
11f7463986
Support decimal create with leading zero (#4286)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-10-30 14:32:32 +01:00
Zoltan Herczeg
c7986fd2c5
Implement rest parameter support for destructuring object patterns. (#4318)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-10-29 10:49:08 +01:00
Csaba Osztrogonác
01c0ca3b6c
Fix sign-compare compiler warning in js-scanner-util.c (#4293)
Found by mingw32-gcc (MinGW.org GCC Build-2) 9.2.0.

comparison of integer expressions of different signedness:
'intptr_t' {aka 'int'} and 'unsigned int' [-Werror=sign-compare]

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
2020-10-19 14:29:13 +02:00
Zoltan Herczeg
f384642409
Implement proper function length support (#4290)
Comma after last destructuring argument has been fixed as well

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-10-19 10:55:26 +02:00
Dániel Bátyai
080abb94ca
Check for prototype bound name in class static accessors (#4257)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-10-16 17:02:17 +02:00
Zoltan Herczeg
841d536fce
Implement proper arguments support (#4289)
- Store arguments in a register when possible
- Create separate arguments object for function argument initializer when necessary

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-10-16 11:02:36 +02:00
Dániel Bátyai
650269feca
Exporting undeclared variables should throw a SyntaxError (#4276)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-10-15 14:48:25 +02:00
kisbg
da1a4bbd44
Implement numeric-separator (#4158)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-10-12 11:33:03 +02:00
Dániel Bátyai
17c8ec57bb
Propagate strict mode flag from scanner when parsing functions (#4262)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-10-06 10:25:13 +02:00
Péter Gál
261a55c6b5
Fix class handling with disabled module system (#4247)
If the module system is disabled however the es.next is enabled the following
code triggers an assert:

```js
class Demo {}
```

This was due to an incorrect scanner data processing where it was always
assumed that there is a module related information.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-10-01 16:36:48 +02:00
Zoltan Herczeg
4b2dbd5c21
Correctly set flags of identifiers related to classes (#4233)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-09-30 12:45:53 +02:00
Dániel Bátyai
f58f15077f
Bound names of for-in/of statements cannot contain let (#4225)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-09-25 16:33:11 +02:00
Zoltan Herczeg
bc64957d19
Properly implement static class fields. (#4221)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-09-25 14:23:02 +02:00
Dániel Bátyai
629a0e51c4
Legacy octal escapes should not be allowed in template strings (#4227)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-09-25 10:14:28 +02:00
Dániel Bátyai
43e03a1ac6
Fix continue label lookup in for statements that have a private scope (#4224)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-09-25 10:06:19 +02:00
Zoltan Herczeg
4d135bec5d
Rework frame context (#4200)
A new shared frame context data is created which allows sharing
data between the function call and vm main loop. Furthermore
rest arguments and current function object handling is reworked.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-09-21 10:25:17 +02:00
Zoltan Herczeg
d9653823ca
Initial implementation of class fields (#4191)
Missing features:
 - this binding in static fields are not supported
 - static field evaluation order is wrong
 - function names are not supported

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-09-17 15:22:55 +02:00
Zoltan Herczeg
2bc3111e31
Improve error detection of nullish coalescing operator (#4179)
Also rename LEXER_IS_BINARY_LVALUE_TOKEN to LEXER_IS_BINARY_LVALUE_OP_TOKEN
because its name is wrong.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-09-07 14:43:41 +02:00
Robert Fancsik
2f08d8ac08
Fix evaluation order in non-binding destructuring patterns (#4173)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-08-28 15:13:02 +02:00
Robert Fancsik
6d0e948bef
Introduce new API functions to obtain detailed object type information (#4162)
- jerry_object_get_type
- jerry_function_get_type
- jerry_iterator_get_type
- jerry_value_is_async_function

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-08-28 12:53:56 +02:00
Zoltan Herczeg
84bc1e03fb
Detect assignment pattern for for-in/of (#4140)
Furthermore do not allow default value for rest parameter

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-24 14:47:10 +02:00
Zoltan Herczeg
f761427a3e
Improve BigInt support (#4118)
This patch adds several small features:
- Support right shift with negative numbers
- Support exponentation operator
- BigInts can be enabled in ES5.1 mode
- Remove dead code from ecma_deref_bigint
- Support longer BigInt literals in the parser
- Fix various BigInt comparison issues
- Do not discard unary plus for BigInt constants

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-11 11:25:01 +02:00
Zoltan Herczeg
39fe04814e
Implement unary operators: bitwise not, pre/post increment/decrement (#4116)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-10 22:38:34 +02:00
Zoltan Herczeg
531f724926
Change BigInt zero representation to a constant (#4109)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-06 12:17:39 +02:00
Csaba Osztrogonác
c76736eadf
Methods shouldn't have prototype property (#3964)
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
2020-08-05 14:01:58 +02:00
Szilagyi Adam
019dd03fcc
Implement JSON superset (#4099)
JSON strings can contain unescaped LINE SEPARATOR and PARAGRAPH SEPARATOR in ES11

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-08-04 16:56:08 +02:00
Zoltan Herczeg
b5a96c9eca
Implement BigInt literal parsing in the parser. (#4089)
Support octal literals for BigInts.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-04 14:16:38 +02:00
Dániel Bátyai
26a299adf0
Fix block-scoped var/function redeclarations (#4080)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-07-31 17:43:15 +02:00
Péter Gál
26c1ffaf71
Fix build with disabled ES2015 module system (#4084)
With a disabled ES2015 module system the build fails as an enum value
is incorrectly guarded and used.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-31 15:51:43 +02:00
Péter Gál
56e328be41
Fix conversion and signedness warnings (#4079)
In case of ARM Nuttx build with IoT.js there are small conversion
and signedness warnings resulting in a build failure.

```
ecma-builtin-regexp-prototype.c: error: conversion from 'int' to '_Bool8' {aka 'unsigned char'}
  may change value [-Werror=conversion]
  116 |   return ecma_make_boolean_value (flags & re_flags[offset]);
      |                                   ~~~~~~^~~~~~~~~~~~~~~~~~

js-scanner-util.c: In function 'scanner_pop_literal_pool':
js-scanner-util.c:628:43: error: comparison of integer expressions of different signedness:
  'intptr_t' {aka 'int'} and 'unsigned int' [-Werror=sign-compare]
  628 |       else if (diff >= -UINT8_MAX && diff <= UINT16_MAX)
      |                                           ^~
js-scanner-util.c:891:43: error: comparison of integer expressions of different signedness:
  'intptr_t' {aka 'int'} and 'unsigned int' [-Werror=sign-compare]
  891 |       else if (diff >= -UINT8_MAX && diff <= UINT16_MAX)
```

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-29 00:05:35 +02:00
Zoltan Herczeg
dff2a2a6da
Rework ascii string to use less memory. (#4030)
Furthermore rename utf8_string to short_string.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-07-28 15:47:07 +02:00
Robert Fancsik
dbea5e6a22
Indentifier should be expected after static in class body. (#4061)
This patch fixes #4055.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-28 10:58:09 +02:00
Robert Fancsik
2e2b0dafb0
Fix scope stack lookup for literal indices (#4067)
This patch fixes #4051.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-28 10:55:13 +02:00
Robert Fancsik
4d5757d1b1
Fix argument list end validation after destructuring argument (#4070)
This patch fixes #4050.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-28 10:53:08 +02:00
Robert Fancsik
9872c441e3
Fix invalid destructuring function arguments parsing (#4074)
This patch fixes #4016 and fixes #4019.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-28 10:41:45 +02:00
Robert Fancsik
daa409a09a
Remove invalid assertion from parser_flush_cbc (#4063)
This patch fixes #4054.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-27 19:38:19 +02:00
Robert Fancsik
11c2ae30d1
Invalid regexp patterns should not throw syntax error during parsing (#4038)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-27 09:28:26 +02:00
kisbg
d39a076b2e
Added RegExp dotAll flag (#4000)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-07-24 13:42:57 +02:00
Robert Fancsik
f596211553
Fix tagged template literal call precedence for new operator (#3998)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-24 11:22:09 +02:00
kisbg
dfd9d4497a
Implement nullish coalescing operator (#3997)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-07-17 15:42:51 +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
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
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
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
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
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