2418 Commits

Author SHA1 Message Date
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
Yonggang Luo
83f9c38ed1
Completely remove JERRY_ATTR_SECTION (#4383)
PR #2903 removed only a part of JERRY_ATTR_SECTION.

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2020-12-29 09:02:20 +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
7e135b04ed
Fix literal printing in byte code dump. (#4359)
Fixes #4353

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-11 13:59:48 +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
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
Zoltan Herczeg
de37e1e049
Template literal arrays should not be marked. (#4352)
Make array object big endian compatible.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-04 10:41:14 +01:00
Zoltan Herczeg
c0fc67f5bd
Rework built-in processing of JerryScript (#4347)
- All built-ins are native functions now
- Native handlers have a built-in id: ECMA_BUILTIN_ID_HANDLER
- Built-in routine identifiers start from 1
- Built-in routines have an own flag set
- Name property of routines is resolved dynamically
- Style fixes

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-12-01 11:37:08 +01:00
Leesoo Ahn
290e845759
Do not check call_arguments twice through parsing call expression (#4346)
Checking call_arguments twice happens in a special case that
only if call_arguments <= 1 and opcode variable has CBC_EXT_SUPER_CALL.

JerryScript-DCO-1.0-Signed-off-by: Leesoo Ahn lsahn@ooseel.net
2020-12-01 11:29:25 +01:00
Péter Gál
5bd88e2723
Correct Regexp literal error release (#4351)
The error object for an incorrect Regexp literal was derefed then the error message
was accessed. This could lead to a state where the message was not available but
it was still accessed.

This could occur in case of heavy memory load or with mem stress mode.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-12-01 11:28:04 +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
Péter Gál
cc52282f34
Correctly mark the arguments.callee value in gc (#4345)
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-11-24 05:19:16 +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
Péter Gál
d2c523b2c0
Use correct flag when checking for static snapshot in arguments object (#4343)
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-11-19 11:23:44 +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
Péter Gál
5d916fb8d4
Correctly handle the Proxy IsCallable and IsConstructor information (#4264)
The `IsCallable(target)` and `IsConstructor(target)` info
can't be stored in the target/handler values.
If the input for the ProxyCreate was a revocable Proxy the original target's
callable/constructor information must be retained even after the
Proxy was revoked.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-11-17 10:38:25 +01:00
Akos Kiss
7262b98021
Add script to extract JerryScript version from headers (#4333)
This can be used at configuration time to
- display version in diagnostics, and
- to write proper version number in pkgconfig files.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2020-11-17 10:36:13 +01:00
Péter Gál
65db83561f
Implement rest parameter support for destructuring object patterns in for (#4338)
In case of `for (const {...rest} ...) ` there was an incorrectly handling
of the destructuring pattern.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-11-17 10:35:27 +01:00
Virag Orkenyi
fab35c3f93
Fix the indexing problem in typedarray_prototype_index_of & last_index_of (#4305)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2020-11-16 15:43:55 +01:00
Virag Orkenyi
f7b7873a02
Extend Jerry API & API documentation with regex flags (#4246)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2020-11-16 15:42:27 +01:00
Zoltan Herczeg
1237bef0f0
Variables created by eval in strict mode should ignore the properties of their parent function. (#4339)
Fixes #4018

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-11-16 15:04:22 +01:00
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
Akos Kiss
81702ff5ea
Drop the minimal variant of the default port implementation (#4331)
The minimal variant became quite meaningless lately. There were two
port APIs originally that had extra functions in the default port
in addition to the core-mandated implementations: the I/O and
Termination port APIs. However, the extra Termination API code was
removed a year ago, leaving some minimal extension in the I/O port
only. As the overhead of the extension is negligible, it is not
worth maintaining two library variants.

Therefore
- this commit removes the minimal variant of the default port lib,
- rewrites uses of the minimal variant to use the variant with the
  I/O extension, and
- updates targets where I/O port code was copy-n-pasted.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2020-11-16 11:54:01 +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
b2084e0a02
Implement from and to property descriptor API function (#4245)
Also added two new helper method:
ecma_property_descriptor -> jerry_property_descriptor converter method
jerry_property_descriptor -> ecma_property_descriptor converter method

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2020-11-03 14:27:26 +01:00
Ádám Kallai
d0e385f9eb
Fix the ESNext build with disabled JERRY_BUILTIN_PROXY (#4320)
With a disabled JERRY_BUILTIN_PROXY option the build fails becouse
of missing guards.

The run-test buildoption_test is also extended with this.

JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu
2020-11-02 09:30:43 +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
Daniella Barsony
3bad85b83b
Add Boolean Prototype Dispatcher (#4308)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-10-29 12:24:32 +01:00
Daniel Balla
b7ca097436
Property key filter API (#4311)
Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu>

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-10-29 11:10:21 +01:00
Daniel Balla
e681adce05
Fix sweeping ecma_promise_value_thunk function objects (#4312)
Fixes #4214

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-10-29 10:50:37 +01:00
Daniella Barsony
72c92d6b36
Add Array Builtin Dispatcher (#4310)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-10-29 10:49:36 +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
Daniella Barsony
484e999dec
Add Promise Prototype Dispatcher (#4309)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-10-28 15:09:17 +01:00