1729 Commits

Author SHA1 Message Date
Péter Gál
abedab5ac2
Fix objects foreach unittest in case of mem-stress-test (#4460)
When the mem-stress-test is enabled for the objects foreach unittest
the object counting is off by one. This was due to incorrect assumption
on when the gc is triggered.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-15 20:50:26 +01:00
Robert Fancsik
ad7fc07ca4
Add missing error check for for-in HasNext check (#4471)
This patch fixes #4464.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-15 20:48:49 +01:00
Péter Gál
b0ca537a34
Correctly release values in Proxy.[[Get]] (#4477)
In Proxy.[[Get]] if the target.[[GetOwnPropertyDescriptor]] fails the
trap result should be freed.

Fixes: #4466

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-15 20:48:13 +01:00
Yonggang Luo
9ce7e49073
rename misspell regression tests file name. (#4479)
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2021-01-15 20:46:57 +01:00
Tóth Béla
91baa17c51
Update TypedArray builtins to latest standard (#4210)
- Introduce `ecma_typedarray_species_create` and `ecma_typedarray_create`
- Update Typedarray's filter method

JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2021-01-15 15:21:50 +01:00
Robert Fancsik
b46535cb8d
Add strict flag check for ecma_op_object_put_apply_receiver (#4450)
This patch fixes #4441.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-15 14:11:47 +01:00
Robert Fancsik
363bc92529
Remove new target workaround from super call (#4447)
After #4372 and #4369 all builtin constructors have new target support.

This patch fixes #4446.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-15 13:28:59 +01:00
Szilagyi Adam
df6d430289
Refactor ecma_builtin_global_object_unescape (#4115)
based on ECMA-262 v11, B.2.1.2

Fixed tests from the exclude list:
* annexB/built-ins/unescape/four-ignore-bad-u.js
* annexB/built-ins/unescape/four.js
* annexB/built-ins/unescape/two.js

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2021-01-14 16:16:32 +01:00
Péter Gál
75586242ba
Fix error instance query if the error is from a Proxy (#4459)
When accessing an error's type there is no need to check the Proxy
prototype (as there is none).

Fixes: #4440

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-13 15:14:04 +01:00
Zoltan Herczeg
3193e6d0dc
Implement jerry_get_backtrace_from API function (#4454)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-01-12 19:52:05 +01:00
Robert Fancsik
4399744588
Remove file(GLOB ...) usage from CMakeLists.txt (#4427)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-12 10:47:36 +01:00
Robert Fancsik
5cef002ed6
Fix underscore lookahead in hex literal parsing (#4448)
This patch fixes #4442.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-11 18:48:53 +01:00
kisbg
8ddd24f870
Add new target support to Error object and NativeErrors (#4372)
EcmaScript 11 19.5.1.1 Error
EcmaScript 11 19.5.6.1.1 NativeError

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2021-01-11 15:08:21 +01:00
kisbg
2919a6463f
Add new target support for ArrayBuffer and TypedArray (#4369)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2021-01-11 14:20:28 +01:00
Robert Fancsik
dcf9252892
Fix mapped arguments legacy argument definition initialization (#4434)
This patch fixes #4432.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-11 12:30:52 +01:00
kisbg
4c41f8ee07
Add proxy and bound function support for GetRealm method(#4407)
ecma_op_function_get_function_realm now can process proxy and bound functions.

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2021-01-11 11:31:27 +01:00
Robert Fancsik
7b00db4079
Fix unavailable source file handling in main_print_unhandled_exception (#4424)
This patch fixes #4403.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-08 16:03:33 +01:00
Robert Fancsik
b56fa43aa3
Fix VM stack size calculation for class initializer assignments (#4426)
This patch fixes #4413.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-08 14:08:55 +01:00
Robert Fancsik
238f9aab4a
Tagged template literal array should be marked after construction (#4420)
This patch fixes #4385.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-08 13:07:34 +01:00
Akos Kiss
d161e2d9ed
Disable libjerry-math by default (#4428)
Normally, it is more usual and safe to use a toolchain's native
math library. Especially, if multiple components of a project use
math functions, in which case all components should be linked
against the same libm.

The libjerry-math can be used, of course, but as it needs extra
care and consideration, it should be opt-in.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2021-01-08 11:37:46 +01:00
Robert Fancsik
0a3aa0f48b
Proxy.[[Set]] should reject falsish trap result in strict mode (#4418)
This patch fixes #4398.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-07 17:25:29 +01:00
Robert Fancsik
979a0c7826
Fix bytecode emitting for invalid regexp literals (#4422)
This patch fixes #4408.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-07 17:19:52 +01:00
Péter Gál
7972386412
Fix shifting a negative value when using BigInts (#4429)
When shifting a negative BigInt value if the
shift count is very "big" the result should be -1.

eg.:
```
(-2n >> (2n*32n)) === -1n
```

Note: the `-2n >> (2n*31n)` already returned `-1n` prior this change.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-07 12:45:10 +01:00
Robert Fancsik
6dfd02a08c
Bound function 'length' property should be early initialized (#4421)
This patch fixes #4402.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-07 12:10:54 +01:00
Robert Fancsik
fc701aef6d
Fix reference count management in %TypedArray%.prototype.reduce{Right} (#4419)
This patch fixes #4397.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-07 11:59:16 +01:00
Péter Gál
61d172aaaf
Don't use property list pointer to store Proxy flags (#4415)
Proxy flags (IsCallable, IsConstructor) can't be stored on the
property list compressed pointer. As adding a Proxy to a WeakSet
would add a property to the Proxy object causing failures down the line.

The prototype internal "slot" can be used to store there flags as
it is not used in case of Proxies (as per standard).

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-07 11:53:59 +01:00
Zoltan Herczeg
128f18a225
Fix mutable binding creation for realms with proxy this binding (#4370)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-01-07 11:09:33 +01:00
Zoltan Herczeg
7baaafa405
Fix the return value of jerry_to_property_descriptor function (#4371)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-01-07 11:09:07 +01:00
Robert Fancsik
cab266f21d
Fix inherited property type check in ordinary object.[[Set]] (#4425)
This patch fixes #4405.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-06 11:25:14 +01:00
kisbg
2ac3c08c14
Add proxy check in ecma_op_object_put_with_receiver (#4411)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2021-01-06 08:44:48 +01:00
Robert Fancsik
6279670484
Fix lookahead in lexer_check_numbers (#4423)
This patch fixes #4375.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-06 07:30:09 +01:00
Akos Kiss
257814d063
Rename jerry-libm to jerry-math (#4410)
That "libm" in the name of the library resulted in awkward naming
on *nix systems (`libjerry-libm.*`, "lib" occurring twice). And the
name of the corresponding header is `math.h` anyway.

Note that this is a breaking change in some sense. The commit
contains no API change, but the build system does change for users
of the math library.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2021-01-05 12:50:07 +01:00
Zoltan Herczeg
9676500add
Implement get proxy target (#4367)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-18 10:58:48 +01:00
kisbg
1937f820e1
Added new target support to Boolean, String, Number Object (#4368)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-12-17 09:44:59 +01:00
Zoltan Herczeg
e2be8f4c79
Get the 'this' binding of a realm value (#4365)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-16 13:21:20 +01:00
Péter Gál
035e5a27fa
Correctly release wrapper object in JSON stringify (#4361)
When an error occurs accessing a property during JSON stringify call
the wrapper object is not freed at the correct place.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-12-15 11:18:14 +01:00
Péter Gál
fe216d4710
Add missing BigInt type for value type query API (#4362)
Extended the `jerry_type_t` enum with `JERRY_TYPE_BIGINT` and added it to
the `jerry_value_get_type`.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-12-15 11:17:11 +01:00
Péter Gál
9380d93416
Fix assert in BigInt TypedArray filter and reduce methods (#4364)
The assert in the reduce and filter methods did not checked if the given value
is a BigInt. This missing check caused the assert to fail.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-12-15 11:14:58 +01:00
Peter Marki
0b72150190
Add cbc flush before statement parsing in constructors (#4358)
Fixes #4238

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-12-15 11:13:32 +01:00
Zoltan Herczeg
29be24f056
Fix var and function declaration in eval (#4360)
Fixes #4149

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-14 11:30:45 +01:00
Zoltan Herczeg
fe29bf7390
Allow changing the 'this' binding of a realm (#4357)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-14 10:05:30 +01:00
Zoltan Herczeg
cc1e8d2dee
Continue working on realms (#4356)
- Rework symbols to have the same value across realms
- Support realms for native functions
- Support test262
- Use new.target realms for constructing intrinsics

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-09 17:44:21 +01:00
Zoltan Herczeg
df92c86ecf
Implement realm object and support realms for built-ins and JS functions (#4354)
- Type for realm objects is introduced (ecma_global_object_t)
- Realm reference is added to built-in objects and ECMAScript functions
- Resolving built-ins, global environments, and scopes require realm object
- Unnecessary global object accesses are removed from the code

Missing: external functions and static snapshot functions have no realm reference

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-08 14:36:36 +01:00
kisbg
7cb9f808f7
Add support test262 $262 global object support (#4329)
Few test-cases in test262 uses a $262 object to run a few method (for example detachedArrayBuffer)

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-12-07 17:06:15 +01:00
Péter Gál
89ff0fcf1f
Handle revoked Proxy during [[Get]] operation (#4349)
The handling of Proxy.[[Get]] was not fully correctly in the case when the
Proxy was revoked during the execution of the handler.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-12-04 10:49:40 +01:00
Peter Marki
8eda7cb7d8
Remove LITERAL_POOL_IN_EXPORT flag at class statement end (#4348)
Fixes #4265

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2020-11-30 10:50:13 +01:00
Virag Orkenyi
19011258d8
Fix the optional argument problem in typedarray_prototype_reduce_... (#4323)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2020-11-26 12:06:22 +01:00
Péter Gál
3af3597f2e
The constructor check should return false for arrow and generator functions (#4328)
The previous `ecma_is_constructor` implementation did not checked if the
target function was an arrow or generator function. This resulted in
an incorrect execution for these function types.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-11-24 12:46:44 +01:00
Zoltan Herczeg
cbc3a5d291
Fix function calls which name is async and has an extra comma (#4340)
Fixes #4132

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-11-19 11:27:29 +01:00
kisbg
7de7c2168e
Implement asInteger, asUint32 and asInt32 jerry api methods (#4325)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-11-18 07:37:56 +01:00