276 Commits

Author SHA1 Message Date
Zoltan Herczeg
01e0388d77
Add notification callback for Promise operations (#4595)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-02-18 11:29:52 +01:00
Zoltan Herczeg
112ad83aaa
Rework external function handlers (#4599)
Instead of a fixed number of arguments, a call info structure is passed
to the handlers, which can be extended in the future without breaknig the
API. This structure holds new.target value, so its getter function is removed.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-02-17 17:52:19 +01:00
Yonggang Luo
34a6a93597
Fix indent in documentation of cmake options (#4588)
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2021-02-10 10:45:29 +01:00
Yonggang Luo
2a6917b5a5
Fix documentation of cmake options (#4587)
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2021-02-10 01:31:27 +01:00
Zoltan Herczeg
3623ac789d
Introduce generic backtrace capturing (#4555)
Remove jerry_get_backtrace_from function

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-02-04 16:33:59 +01:00
Zoltan Herczeg
9ca046b670
Add non-standard behaviour support for Proxies (#4562)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-02-04 15:58:16 +01:00
Péter Gál
62dc782e5c
Extend jerry_create_realm API docs a bit (#4549)
Add additional information for jerry_create_realm method and rework the
example to be a compilable/runnable doctest.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-29 13:15:37 +01:00
Péter Gál
0e21c17080
Add missing version info to API docs (#4541)
A few new methods did not have the version info to describe
in which version were they introduced.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-25 15:59:00 +01:00
Szilagyi Adam
6ec4455111
Implement Symbol.matchAll (#4082)
The following methods were implemented:
- String.prototype.matchAll based on ECMA-262 v11, 21.1.3.12
- RegExp.prototype[@@matchAll] based on ECMA-262 v11, 21.2.5.8
- RegExp String Iterator Object based on 21.2.7

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2021-01-18 18:08:35 +01:00
Péter Gál
b313824228
Update API docs for 2.4 release (#4504)
Replace the [[NEXT_VERSION]] entries with the exact version number
in the API reference documentation.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2021-01-18 18:01:10 +01:00
Zoltan Herczeg
3b77117a2e
Add a callback which is called when Error objects are created (#4465)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-01-18 16:56:38 +01:00
Dániel Bátyai
0fec9135ec
Rework module parsing and execution (#4462)
This patch disables automatic detection of module code, and instead
requires the user to explicitly specify whether to parse a source
as a module or as a script.

To achieve this the jerry_parse API function now takes a new option
which signals that the source should be parsed as a module.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2021-01-18 15:33:43 +01:00
Robert Fancsik
c4676a21fe
Introduce jerry_port_track_promise_rejection (#4451)
This patch resolves #2931.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-18 14:59:42 +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
Zoltan Herczeg
6f0391dd66
Unify internal property creation (#4373)
Furthermore free up a bit in the property descriptor.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-01-12 13:12:44 +01:00
Akos Kiss
fdaacde667
Officially introduce amalgamated builds (#4416)
Remove redundancy between all-in-one and all-in-one-source builds
by keeping only the second, and adopt the more established term
"amalgamated" build for it. This change includes the following:

- Replace `ENABLE_ALL_IN_ONE` and `ENABLE_ALL_IN_ONE_SOURCE` cmake
  options with `ENABLE_AMALGAM` top-level option.
- Replace `--all-in-one` option of `build.py` helper with
  `--amalgam`.
- Merge the `srcmerger.py` and `srcgenerator.py` tool scripts into
  `amalgam.py` (with improvements).
- Update documentation.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2021-01-11 13:07:40 +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
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
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
6083259030
Add missing version information in API reference document (#4363)
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-12-15 11:19:22 +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
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
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
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
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
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
596964ae0d
Update jerry_run_all_enqueued_jobs() function and documentation (#4283)
Make sure it always returns an error or an undefined value.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-10-10 09:03:52 +02:00
Robert Fancsik
e3481d431b
Revise the API ArrayBuffer related operations (#4284)
- External ArrayBuffer construction with 0 length should be equivalent to `new ArrayBuffer(0)`
- Internally allocated ArrayBuffers should be detachable
- Externally allocated ArrayBuffers free callback should be called when underlying buffer is detached

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-10-09 15:12:45 +02:00
Zsolt Borbély
aa89d38df3
Various minor improvements to reference document (#4259)
- add version notes in case of JERRY_TYPEDARRAY_BIGINT64, JERRY_TYPEDARRAY_BIGUINT64
 - add code highlight to type values (JERRY_INIT_MEM_STATS_SEPARATE, JERRY_INIT_MEM_STATS_SEPARATE)
 - add newlines to break the version notes into separate lines
 - add missing periods

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2020-10-01 13:10:42 +02:00
Zoltan Herczeg
3c723c9bc1
New jerry_get_symbol_description API function (#4206)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-09-21 10:39:38 +02:00
Robert Fancsik
1fd0cac8c9
Introduce new API function to obtain well-known symbols (#4163)
- jerry_get_well_known_symbol

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-08-31 10:03:05 +02:00
Robert Fancsik
cd1c06510e
Support BigInt64/BigUint64 typedarray creation from API (#4170)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-08-28 13:14:40 +02:00
Robert Fancsik
6d0e948bef
Introduce new API functions to obtain detailed object type information (#4162)
- jerry_object_get_type
- jerry_function_get_type
- jerry_iterator_get_type
- jerry_value_is_async_function

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-08-28 12:53:56 +02:00
Zoltan Herczeg
cb14682983
Create API for handling BigInts (#4111)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-07 13:43:29 +02:00
Zoltan Herczeg
0124368ae7
Implement external strings. (#4028)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-07-22 12:27:12 +02:00
Robert Fancsik
39cb67397d
Remove the usage of ecma_length_t (#4009)
Now the following conventions are applied:
 - passing the number of arguments for a function call is always uint32_t
 - string size/length/position related operation should use lit_utf8_size_t
 - Extended objects internal fields must be uint32_t

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-20 16:36:27 +02:00
Péter Gál
0c61aee597
Improve the JSON C API (#3943)
* Added more details into documentation.
* Moved the C unit-test into its own file.
* Added extra test cases.
* Extended the API reference documentation with doctests.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-01 14:50:39 +02:00
Robert Fancsik
cc4ac497b7
Merge jerry-test-suite into jerry tests (#3907)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-06-17 13:00:41 +02:00
Csaba Osztrogonác
b469f0e9a8
Documentation typo fixes (#3904)
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-06-16 18:54:36 +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
Péter Gál
01e9670365
Update API version to 2.3 (#3889)
Update the API reference doc also.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-06-10 13:02:30 +02:00
Csaba Osztrogonác
1bd1a36a81
Bump reference platform to Ubuntu 18.04 LTS (#3037)
Ubuntu 14.04 reached its end of life on April 30m 2019.
Let's bump the reference to the latest LTS, which is 18.04.

Ubuntu 18.04 has newer Pylint and Cppcheck, the necessary
fixes and suppresses are also included in this PR.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2020-03-30 12:26:56 +02:00
Akos Kiss
f29e6f9020
Fix undefined overflow behavior when converting double to integer (#3629)
Overflows in conversions from floating-point to integer are
undefined behavior in the C99 standard. (Clause 6.3.1.4: "If the
value of the integral part cannot be represented by the integer
type, the behavior is undefined.")

When UBSAN is enabled, this gets reported at `srand()` calls. (The
random seed is usually initialized using the date port API, which
represents dates as `double`s. But `srand` takes an `unsigned int`.
A simple cast from `double` to `unsigned` becomes undefined
behavior if the value is too large. And "now" is too large
nowadays. So, effectively, all executions start with an undefined
behavior.)

This patch fixes this by casting the floating-point value of the
date to an integer through a union.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2020-03-27 11:03:28 +01:00
Daniel Balla
9509c3da85
Add Map, Set, WeakMap, WeakSet basic functionality to the API (#3502)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2020-03-10 18:10:56 +01:00
Robert Fancsik
4e136c8973
Implement the core of Proxy object (#3562)
- Internal routines of the of the proxy object are unimplemented
 - For-in enumerate with proxy target is currently not supported

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-02-28 14:41:59 +01:00
Péter Gál
0d7f26e2c4
Add a few missing api version documentation (#3542)
A few api method/struct documentation did not have the
entry describing in which version it was introduced.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2020-02-04 13:17:24 +01:00
Péter Gál
24af089643 Introduce new.target C api (#3522)
Added new "jerry_get_new_target" API function
and updated the unit test.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2020-01-18 10:58:33 +01:00