1264 Commits

Author SHA1 Message Date
Péter Gál
daf3b36ea6 Fix new.target invalidity check (#3521)
Fixes #3519

Only check the assert if the new.target bytecode is detected.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2020-01-16 16:03:59 +01:00
Peter Marki
51244b6d08 Add option to list symbols in Object.getOwnPropertyNames() (#3507)
Also a little refactoring of Object.getOwnPropertyNames()

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-01-16 15:59:27 +01:00
Robert Fancsik
8b41bf306a
Introduce builtin intrinsic object to share property values between builtin objects (#3490)
Fixed:
 - Global symbol access
 - Array.prototype.values and Array.prototype[Symbol.iterator] must be the same function object

To test the new functionality arguments object Symbol.iterator property is added.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-16 15:57:27 +01:00
Daniel Balla
332e216736 Add runtime option "--call-on-exit [FUNCNAME]" to main-unix.c (#3518)
With this option you can call a function after the user script and promises have ran, to be able to do assertions that are executed just before the process would exit.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-01-15 17:10:42 +01:00
Robert Fancsik
4a331b2edc
Add builtin GeneratorFunction support (#3499)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-15 12:01:58 +01:00
Robert Fancsik
210b631b21
Fix iterator position calculation for array patterns (#3494)
This patch fixes #3455.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-14 16:03:26 +01:00
Zoltan Herczeg
0d7b461185 Correctly handle celestial plane codepoints in ES5.1. (#3510)
Fixes #3498.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-01-14 15:11:59 +01:00
Zoltan Herczeg
d6070a9fed Call filter arguments after the global arguments are parsed. (#3511)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-01-14 15:10:19 +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
Robert Fancsik
be8ae3aae8
Add iterator close support for for-of statement (#3401)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-13 17:38:47 +01:00
Zoltan Herczeg
f1dd59e4bd Property modifiers should not be checked before an equals. (#3509)
Fixes #3434.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-01-13 15:14:29 +01:00
Zoltan Herczeg
9a8160176c Nested destructuring binding patterns should inherit the PARSER_PATTERN_ARGUMENTS flag. (#3508)
Fixes #3398.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-01-13 15:13:57 +01:00
Robert Fancsik
be83ff6b71 Update Function.prototype.bind to conform ES6 requirements (#3504)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-13 11:43:11 +01:00
Robert Fancsik
d0e8629342 Support nested destructuring patterns in catch header (#3488)
This patch fixes #3433.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-13 11:39:07 +01:00
Daniel Balla
1725e014b8 Support iterable objects in Promise.all and Promise.race functions (#3496)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-01-10 15:44:52 +01:00
Virag Orkenyi
b6c2e6eb54 toNumber operation should handle binary and octal literals (#3471)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2020-01-10 15:31:54 +01:00
Robert Fancsik
b3b1dfdabd
Tagged template object references should be released only in post_processing (#3495)
This patch fixes #3483.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-10 15:25:40 +01:00
László Langó
2960dffb50 Support all literals in 'jerry_get_literals_from_snapshot' when C format is used. (#3472)
The literals must be saved in hex format to support cases with special
characters, like `var s = 'hello",\n"world';`

JerryScript-DCO-1.0-Signed-off-by: László Langó lango@inf.u-szeged.hu
2020-01-10 14:57:10 +01:00
Peter Marki
08da8bc7aa Add length check to ecma_builtin_array_prototype_object_slice (#3481)
Fixes #3479

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-01-10 12:16:53 +01:00
Robert Fancsik
dc3de8d8ae
Fix for-of block context creation for empty destructuring pattern (#3492)
This patch fixes #3421.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-08 14:55:02 +01:00
Szilagyi Adam
aedd55b1f8 Add unscopables check to ecma_op_get_value_lex_env_base (#3476)
Also added a special test case for this to symbol-unscopables.js

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-01-07 15:13:28 +01:00
Robert Fancsik
003694d259
Throw error for generator function class constructor (#3489)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-01-07 14:52:01 +01:00
Szilagyi Adam
22e52e45af Fix value release in ecma_builtin_typedarray_prototype_map (#3491)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-01-07 14:25:59 +01:00
Csaba Osztrogonác
9e0709e401 Fix Array.prototype.reduce and reduceRight (#3487)
Don't throw TypeError when object length is 0 and initialValue is undefined.
Additionally the error message should be more precise and match other engines.

Fixes #3463

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-01-06 15:17:54 +01:00
Peter Marki
300570381f Add fast-path check to ecma_builtin_array_prototype_slice (#3480)
Fixes #3459

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-01-06 10:30:10 +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
Daniel Balla
e21e4a18ba Fix freeing this_arg in ecma_builtin_promise_race_or_all (#3482)
Fixes #3478

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-01-03 14:18:40 +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
Dániel Bátyai
2a29b72a83 Implement and add support for Symbol.split (#3453)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-12-20 09:10:58 +01:00
Csaba Osztrogonác
85bb2113fe Make Math.min() and Math.max() ECMA262 conform (#3465)
Math.min() and Math.max() functions should apply ToNumber on each arguments
always, even if a NaN argument occured previously and the result will be NaN.

ECMA262 v5.1 15.8.2:
"Each of the following Math object functions applies the ToNumber abstract
operator to each of its arguments (in left-to-right order if there is more
than one) and then performs a computation on the resulting Number value(s).

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-12-20 08:57:17 +01:00
Robert Fancsik
ea5ad2a06f Fix the parsing/scanning of empty return statement (#3468)
This patch fixes #3467.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-19 19:31:59 +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
Szilagyi Adam
7bfbc701d8 Implement Symbol.unscopables (#3405)
Added a new property for Array.prototype based on ECMA-262 v6, 22.1.3.31
Also upgraded the HasBinding operation with ECMA-262 v6, 8.1.1.2.1 steps 7-9

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-19 16:34:23 +01:00
Daniel Balla
52616f7d8c Early return when the scanner throws an error while parsing an invalid function identifier (#3464)
Fixes #3454

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-12-19 15:50:09 +01:00
Péter Gál
d27a07edf4 Add missing assert entry in case of static super assignment (#3462)
In case of static super member assignments there was a missing
check to validate if the CBC opcode is of CBC_EXT_PUSH_STATIC_SUPER.

Fixes: #3458

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-12-19 12:38:38 +01:00
Szilagyi Adam
e2893f26a1 Add iterator closing for ecma_op_container_create (#3457)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-19 11:40:29 +01:00
László Langó
0428b51e35 Uncomment some fixed test cases (#3452)
After #3440 the Symbol related test cases runs fine for
Arrays, so the TODO had been resolved in that particular
test file.

JerryScript-DCO-1.0-Signed-off-by: László Langó lango@inf.u-szeged.hu
2019-12-17 11:42:56 +01:00
Szilagyi Adam
b6f2ff1ba7 Implement binary literal parsing (#3439)
This patch will allow the user to use binary literals starting with 0b or 0B,
these literals will be evaluated in parsing time resulting an integer

Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-17 11:42:29 +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
Daniel Balla
e0d8c4ca10 Add @@species accessor to Array and Promise builtin objects (#3440)
Fully support @@species and SpeciesConstructor in Array and Promise builtins.
Also added partial support to TypedArrays, but a rework is needed in %TypedArray%.prototype functions' typedarray constructor, which is out of this patch's scope.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-12-16 11:44:15 +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
Csaba Osztrogonác
1db16c3a1c Fix Math.round(x) for big integer numbers (#3449)
Math.round(x) should be x it x is already integer. (ES5 15.8.2.15)
The current implementation calculates with x +/- 0.5, which isn't
representable numbers if x >= 2^52.

A correct bug fix can be to follow the spec and simply
return the number itself if it is already integer.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-12-16 10:57:22 +01:00
Dániel Bátyai
d3b8bed2c1 Implement and add support for RegExp.prototype[@@search] (#3436)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-12-12 15:59:28 +01:00
László Langó
c525b1f10a
Fixed segmentation fault in scanner. (#3444)
The register end index was not correctly calculated when
only holes presented in the arguments list of a function.

Fixes #3419, fixes #3431

JerryScript-DCO-1.0-Signed-off-by: László Langó lango@inf.u-szeged.hu
2019-12-12 12:17:45 +01:00
Csaba Osztrogonác
fb4b18a515 Fix Math.trunc(x) if -1 < x < 0 (#3445)
Math.trunc(x) should be -0.0 if -1 < x < 0 (ES2015 20.2.2.35). The problem
was that -0 isn't -0.0, but +0.0 in C. There were a test case for it, but
it was incorrect, because +0.0 === -0.0 in JS.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-12-12 10:57:44 +01:00
László Langó
df6995d0f6 Fixed typos in filenames of regression tests. (#3443)
JerryScript-DCO-1.0-Signed-off-by: László Langó lango@inf.u-szeged.hu
2019-12-11 16:19:05 +01:00
László Langó
4b5fad748f
Fixed memory leak in rest initializer. (#3438)
Fixes #3437

JerryScript-DCO-1.0-Signed-off-by: László Langó lango@inf.u-szeged.hu
2019-12-11 10:24:49 +01:00
Robert Fancsik
9b33fc8cbd Revise the usage of the global error value/exception flag (#3426)
This patch also fixes #3422.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-12-10 14:42:10 +01:00
Szilagyi Adam
7c0b1ca88a Update String.prototype.match to ECMA-262 v6 (#3375)
The algorithm is based on ECMA-262 v6, 21.1.3.11

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-12-10 14:40:41 +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