1598 Commits

Author SHA1 Message Date
Rafal Walczyna
a4659a888b
Add support of escaping backslash and backtick to String.raw (#3736)
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
2020-05-20 13:26:01 +02:00
Péter Gál
bbb5c9180e
Fix releasing the pattern string in regexp (#3765)
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
2020-05-20 12:10:05 +02:00
Dániel Bátyai
378244942f
Fix iterator closing in Promise all/race (#3759)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-18 21:22:08 +02:00
Dániel Bátyai
7274fa4dd4
Fix rounding in Number.prototype.toFixed (#3747)
Fixes #3741.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-05-18 18:39:00 +02:00
Csaba Osztrogonác
f0d443daec
Add --test262-es2015 option to run-tests.py (#3667)
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-05-18 16:43:17 +02:00
Zoltan Herczeg
e01cfda0b8
Check next token before reparsing identifiers in object assignments. (#3756)
Fixes #3735.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-18 13:16:16 +02:00
Zoltan Herczeg
c4d5c2c9e1
There is no block info after invalid if-function construct. (#3755)
Fixes #3713.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-18 13:15:16 +02:00
Zoltan Herczeg
2570f8e745
Move an assertion after post processing. (#3754)
Fixes #3752.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-18 13:14:17 +02:00
Zoltan Herczeg
09ac2ffa67
Update obsolote assert. (#3752)
Fixes #3713.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-18 13:13:43 +02:00
Zoltan Herczeg
bd1c4df9a6 Fix keyword parsing after use strict. (#3740)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-15 22:32:04 +02:00
Zoltan Herczeg
4aa27371b6 Array or object pattern must be assignment expression. (#3744)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-05-15 22:29:27 +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
kisbg
a6f6bce6f0
Added new target support for Date Object (#3739)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-05-15 22:21:40 +02:00
Mátyás Mustoha
f13e8b602e
Fix position calculations of String.startsWith (#3734)
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
2020-05-15 22:18:42 +02:00
Daniella Barsony
b51157d3c5
Add Array new target support (#3728)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-05-15 16:36:06 +02:00
Szilagyi Adam
95aa827635
Fix value release in ecma_builtin_regexp_dispatch_helper (#3702)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-14 17:10:27 +02:00
Robert Fancsik
9ad9d574fe
Add proxy support for HasBinding operation for Object Environment records (#3731)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-13 14:27:31 +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
Robert Fancsik
df7e303145
Fix apply receiver operation for Proxy objects (#3730)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-11 16:56:41 +02:00
Szilagyi Adam
050fbfc130
Add Proxy support for JSON.stringify (#3685)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-11 15:18:18 +02:00
Szilagyi Adam
094ba2f30a
Update the Array.prototype.reverse method to support ES6 version (#3676)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-11 13:42:46 +02:00
Szilagyi Adam
97a35b0f10
Add new target support to Function object (#3708)
Added steps 1, 2.c, 3.c, 21, 22 to ecma_op_create_dynamic_function

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-11 13:40:50 +02:00
Rafal Walczyna
aa1777b1a0
Update ES6 Regexp accessors descriptors (#3726)
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
2020-05-08 12:25:45 +02:00
Péter Gál
18fe546802
Fix appending elements for ecma collection (#3719)
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
2020-05-07 16:11:14 +02:00
Péter Gál
90c7eccb42
Fix fast array handling when doing put with receiver (#3720)
During "put" with receiver the fast arrays were not converted to normal
objects to correctly set properties on it.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-05-07 09:00:50 +02:00
Rafal Walczyna
99859fb221
Fix prototype of NativeError objects (#3716)
Internal property [[Prototype]] of EvalError, RangeError, ReferenceError,
SyntaxError, TypeError and URIError should be Error.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-05-07 08:58:42 +02:00
Szilagyi Adam
409e1fec5f
Add missing index incrementation to ecma_builtin_string_object_raw (#3709)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-04 15:08:14 +02:00
kisbg
8ccb95c31c
Added new target support to Promise (#3707)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-05-04 15:03:12 +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
Robert Fancsik
40a9f27314
Fix __proto__ parsing in object literals (#3704)
Co-authored-by: Rafal Walczyna r.walczyna@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-05-04 14:49:15 +02:00
kisbg
14cea9c1ec
Added new target support in Map, WeakMap, Set and WeakSet (#3701)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-05-04 14:24:39 +02:00
Szilagyi Adam
b5d9699788
Update the RegExp.prototype.test function to support ES6 version (#3693)
The algorithm is based on ECMA-262 v6, 21.2.5.13

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-04 14:10:56 +02:00
Szilagyi Adam
1a72e070c8
Add value/key sign swap for Set.add and Map.set methods (#3681)
See also: ECMA-262 v6, 23.2.3.1 step 6 and 23.1.3.9 step 6

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-04 14:00:36 +02:00
Daniella Barsony
6ff299c831
Add [[GetOwnProperty]] internal Proxy method (#3672)
Depends on #3662

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-04-30 15:51:23 +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
9e6c44be4f
Fix function declaration issues inside catch blocks. (#3700)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-29 13:53:14 +02:00
Zoltan Herczeg
85401db547
Support function statements after 'if' or 'else'. (#3699)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-29 13:50:01 +02:00
Szilagyi Adam
2bdd0f5008
Accessor functions do not have [[Construct]] internal method (#3698)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-04-29 13:04:57 +02:00
Szilagyi Adam
62730f2ae1
Implement Proxy object [[DefineOwnProperty]] internal method (#3662)
The algorithm is based on ECMA-262 v6, 9.5.6

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-04-28 09:51:01 +02:00
Zoltan Herczeg
f254b1a8b7
Fix invalid / unhandled this_literal cases. (#3696)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-27 14:54:21 +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
daeee77d63
Fix invalid assignment code generation. (#3695)
This patch prevents assigning a value to a string literal after a this token.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-27 10:14:29 +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
Zoltan Herczeg
dcf8ccfd03
Function declaration outside of blocks in direct eval must be ES5.1 compatible. (#3690)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-24 10:45:14 +02:00
Hyukwoo Park
1b1460e61f
Fix attributes of length property for builtin functions (#3689)
fix length property of builtin functions to be configurable (ECMA-262 v6, 19.2.4.1)

JerryScript-DCO-1.0-Signed-off-by: HyukWoo Park hyukwoo.park@samsung.com
2020-04-22 08:36:23 +02:00
Rafal Walczyna
bcd5ff3f40
Implement missing hyperbolic Math functions from ES6 (#3670)
Math.cosh, Math.sinh, Math.tanh

C implementation ported from fdlibm.

Part of Issue #3568

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-04-21 12:34:38 +02:00
Robert Fancsik
d1bf9635c7
Fix incorrect assertion in parser_parse_for_statement_start (#3679)
This patch fixes #3655.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-04-21 12:00:39 +02:00
Zoltan Herczeg
3900152631
Fix delayed variable creation for function declarations. (#3687)
Fixes #3658.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-21 11:59:30 +02:00
Rafal Walczyna
0269b6c25d
Fix is_constructor of bound function (#3684)
Bound function created from built-in function does not have a constructor

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-04-21 11:58:29 +02:00
Zoltan Herczeg
52f1476061
Fix assignment expression pre-scanning for arrow functions. (#3688)
Fixes #3656.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-04-21 11:25:36 +02:00