109 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
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
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
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
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
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
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
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
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
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
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
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
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
b2a6109430
Implement async generators (#3916)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-22 13:54:18 +02:00
Dániel Bátyai
fde0d556ac
Re-target for ES.Next (#3901)
A list of changes:
- 'es2015-subset' profile is deprecated, and an 'es.next' profile is added.
- The default profile is changed to 'es.next'
- Renamed the JERRY_ES2015 guard to JERRY_ESNEXT
- Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_*
- Moved es2015 specific tests to a new 'es.next' subdirectory
- Updated docs, targets, and test runners to reflect these changes

Resolves #3737.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-06-12 17:55:00 +02:00
Zoltan Herczeg
2058ea1286
Implement eval support for functions with arguments lexical env. (#3806)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-06-08 12:11:54 +02:00
Robert Fancsik
fe09200d61
Fix assignment lookahead in parser_process_group_expression (#3828)
This patch fixes #3815 and fixes #3819.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-06-03 15:29:26 +02:00
Robert Fancsik
104001df68
Implement function name support for script functions and classes (#3745)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-28 12:33:21 +02:00
Zoltan Herczeg
1f00d750b7
Implement parsing await. (#3738)
Several bugs fixed for parsing yield as well.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-15 22:26:05 +02:00
Zoltan Herczeg
4dc2cb3328
Implement proper creation of function arguments, let and const declarations. (#3725)
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
2020-05-12 14:38:17 +02:00
Zoltan Herczeg
132a2008c9
Fix function argument handling issues caused by the parser. (#3705)
1) Nested function declarations should not overwrite arguments.
2) Functions should be created in the correct scope.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-04 14:55:46 +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
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
Zoltan Herczeg
e2807c28fa
Implement separate context for arguments. (#3686)
Fixes #3396.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-24 16:55:12 +02:00
Robert Fancsik
b209e95daa
Fix iterator step calculation for bracketed property expressions (#3678)
This patch fixes #3665.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-04-20 19:32:59 +02:00
Zoltan Herczeg
4be9ffda84
Use symbolic constants for code size checks. (#3682)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-17 13:05:07 +02:00
Robert Fancsik
76b8555210
Remove JERRY_CONTEXT_INVALID_NEW_TARGET (#3643)
Until now JERRY_CONTEXT_INVALID_NEW_TARGET was used to represent whether the eval called from the script directly.
This information can be retrieved from the parser, so it simplifies the runtime handling of the new.target.

This patch fixes #3630, fixes #3640 and fixes #3641.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-03-27 11:21:50 +01:00
Robert Fancsik
bfd2639634
Rework the core of class parsing/runtime semantic (#3598)
Changes:
 - Use the pre-scanner to provide information for the parser about the existence of the class constructor
 - The allocation of the super declarative environment is no longer needed
 - The VM frame context holds the information about the this binding status
 - Reduce the number of class related VM/CBC instructions
 - Improve ecma_op_function_{construct, call} to properly set new.target

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-03-16 14:37:47 +01:00
Zoltan Herczeg
bd2696f7c7
Add global status flags for the parser. (#3572)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-02-24 11:22:20 +01:00
Dániel Bátyai
68909fc5de
Fix lexical scoping between scripts (#3558)
This change fixes the handling of lexical blocks when executing multiple
scripts, and also fixes a few issues with module environments.

After this change, all script files will run in the same context and
will have access to lexically scoped global variables of previous
scripts, and module environments will no longer have a bound global
'this' value.

The REPL implementation in main-unix is also fixed to correctly handle
lexically scoped variables.

Fixes #3561.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-02-21 13:30:48 +01:00
Zoltan Herczeg
fda02d4b2a
Fix local scoping for functions. (#3559)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-02-18 09:49:03 +01:00
Zoltan Herczeg
4b325ea9e3
Rework map_to member of the scope chain that it can store flags. (#3552)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-02-13 17:39:56 +01:00
Péter Gál
0fd1ed6f27 Add support for new.target (#3469)
Notable changes:
* Extracted the pure JS/builtin and external C method invocations
  into two new methods (`ecma_op_function_call_{simple, external}`).
* Updated parser/scanner to handle "new.target" correctly.
* Added JS test case.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2020-01-14 13:34:19 +01:00
Zoltan Herczeg
dc15944ebd
Remove lexer_process_char_literal function. (#3474)
Add a test for using large literals.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-01-06 10:13:05 +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
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
Zoltan Herczeg
d0b4e7dd04 Free three parser status flag bits. (#3451)
The operations covered by these bits can be done in a different way.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-17 11:43:37 +01:00
Zoltan Herczeg
3c0beaf87d Support strict mode detection in the pre-scanner. (#3450)
Furthermode an error is thrown when 'use strict' is used in a function with non-simple arguments
and function arguments are not moved to lexical environment when unmapped arguments are present.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-17 10:59:03 +01:00
Zoltan Herczeg
b1237dbc5a Detect keyword type even if the keyword is identifier. (#3448)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-16 13:36:26 +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
Zoltan Herczeg
531f1e9687 Support let identifier in non-strict mode. (#3427)
This code adds a lot of checks and complexity to the code.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-10 14:32:08 +01:00
Zoltan Herczeg
b8bc013fc0 Keywords must not contain escape sequences. (#3429)
The ES5.1 standard is unclear about this rule.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-09 14:37:41 +01:00
Zoltan Herczeg
31988877b2 Support destructuring bindings as catch variables. (#3399)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-12-03 12:52:20 +01:00
Zoltan Herczeg
8956eff2bd Implement generator support for object initializers and classes. (#3372)
Large part of the code is also reworked.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-29 12:28:51 +01:00
Zoltan Herczeg
110f75c99d Implement the core of the generator functions. (#3368)
Some things are missing:
 - yield* support
 - generator definition in object literal
 - the hidden GeneratorFunction

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-28 11:54:27 +01:00
Zoltan Herczeg
70566a52fb Improve eval call parsing. (#3330)
Eval calls are recognised when the eval identifier is encapsulated in brackets.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-19 15:55:53 +01:00
Robert Fancsik
22766a855e Implement spread operator for function call arguments (#3329)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-19 14:06:12 +01:00
Zoltan Herczeg
bf630c0c54 Implement binding pattern support for rest argument and for statement. (#3327)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-19 14:02:17 +01:00
Zoltan Herczeg
8bdb32cc88 Implement function destructuring argument support. (#3322)
Furthermore create unmapped arguments objects if a function has a non-simple argument.
A few destructuring pattern issues were fixed as well.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-18 14:15:36 +01:00
Robert Fancsik
fca0c94002 Fix the initialization of let/const patterns when block context is needed. (#3320)
Also some code cuplication is removed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-15 14:38:14 +01:00