63 Commits

Author SHA1 Message Date
Robert Fancsik
0628ae1e7b
Remove the ENABLED/DISABLED macros (#4515)
The removal of these macros enabled cppcheck to reveal new errors.
These errors are also fixed by the patch.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-02-04 23:47:05 +01:00
Zoltan Herczeg
ba06d492a3
Remove full stop after error messages (#4524)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-01-28 12:10:13 +01:00
Yonggang Luo
fe3b0a8435
Fixes ENABLE_AMALGAM need FORCE set to ON when building with MSVC (#4392)
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2021-01-16 16:44:55 +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
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
Csaba Osztrogonác
24a5489331
Implement ToIndex abstract operation (#4287)
https://www.ecma-international.org/ecma-262/11.0/#sec-toindex

Made DataView constructor, DataView.prototype.setXXX/getXXX methods ES11 conform.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
2020-10-27 10:37:50 +01:00
Virag Orkenyi
fb1c21beb7
Change guarding of ecma_is_value_bigint and ecma_is_value_symbol (#4269)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2020-10-05 14:43:04 +02:00
Philippe
f97c0134d7
Fix compilation warnings when using 32-bit floats (#4199)
JerryScript-DCO-1.0-Signed-off-by: Philippe pgu-swir@users.noreply.github.com
2020-09-28 16:12:21 +02:00
Szilagyi Adam
9589771f7a
Refactor ecma_op_check_object_coercible (#4169)
The method returns bool now instead of an ecma_value_t

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-08-28 13:12:50 +02:00
Virag Orkenyi
777b7e9c87
Cleanup toNumber and toNumeric abstract operations (#4034)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2020-08-27 13:32:30 +02:00
Szilagyi Adam
85981457e6
Implement BigInt64 and BigUint64 typedArrays (#4151)
Also implemented ToBigInt conversion method based on ECMA-262 v11, 7.1.13

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-08-24 18:03:12 +02:00
Zoltan Herczeg
6adf0c1a87
Support BigInt to number conversion using Number constructor (#4121)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-12 16:33:31 +02:00
Zoltan Herczeg
f4f9cde3e7
Fix evaluation order for binary operators (#4114)
Furthermore fix toBoolean for BigInts as well.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-07 14:32:46 +02:00
Zoltan Herczeg
cfd69d3b70
Implement relational operators for BigInts (#4087)
Improve BigInt constructor as well

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-03 13:46:34 +02:00
Zoltan Herczeg
df2f7782f7
Implement BigInt primitve type and some of its operations (#4062)
Supported operations:
- parse BigInt (decimal, hexadecimal, binary)
- toString with any radix between 2 and 36
- arithmetic operations: negate, add, subtract, multiply, divide, modulo
- left and right shift

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-07-30 12:08:34 +02:00
Robert Fancsik
3eb69075f7
Update ToLength operation to conform ES6 spec (#4007)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-29 11:13:34 +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
ae5cfae3e7
Implement ToPropertyKey operation (#3966)
From ES 6 the ToPropertyKey operation is used to convert elements to a valid property key.
This "new" method uses the ToPrimitive operation which can call the `@@ToPrimitive`
well-known symbol to convert the given element to a key.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
2020-07-06 15:17:18 +02:00
Szilagyi Adam
392ee71712
Remove ECMA_TRY_CATCH macro (#3829)
also refactored the touched methods a little bit

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-03 15:06:49 +02:00
Szilagyi Adam
c0b594fa69
Remove duplicate is_object check when calling ecma_op_to_primtive (#3899)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-06-30 13:18:40 +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
Szilagyi Adam
ecf159795a
Rework the Reflect.defineProperty method (#3770)
Also a minor update to the FromPropertyDescriptor operation since in ES6 we can use a property
descriptor whitout any keys

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-05-25 18:09:37 +02:00
Szilagyi Adam
4342c9ea6f
Implement Proxy object [[OwnPropertyKeys]] internal method (#3639)
The algorithm is based on ECMA-262 v6, 9.5.12

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-04-14 16:57:47 +02:00
Roland Takacs
19c61e14c0
Fix float point number comparsion (#3596)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
2020-03-02 15:57:11 +01:00
Daniella Barsony
73daeb19c9
Implement new Reflect methods (#3549)
This patch implements the get, set, has, deleteProperty, ownKeys, and construct methods of the Reflect objects. The Reflect.construct method is missing the new_target support because ecma_op_function_construct doesn't support it yet.

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2020-02-24 11:02:06 +01:00
Szilagyi Adam
183600dff2 Refactor ecma_op_same_value (#3486)
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-01-06 14:33:46 +01:00
Ádám Kallai
f2a67876eb Fix the same Symbol value detection in SameValue function (#3273)
'is_types_equal' checks was missing for Symbol values.

JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu
2019-11-04 16:53:38 +01:00
Szilagyi Adam
4b352758c1 Refactor ecma_op_to_string (#3171)
Similar to the ecma_op_to_object rework, in this new method we
return directly with the pointer to the ecma string, and we don't
wrap the result into an ecma_value_t

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-25 15:58:47 +02:00
Robert Fancsik
3b73562fa5 Revise ES2015 feature guards (#3240)
All the basic language element guards are merged into JERRY_ES2015 macro guard.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-24 14:44:51 +02:00
Daniella Barsony
466dc903fb Add toLength and toInteger operations (#3146)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-10-03 14:05:23 +02:00
Daniel Balla
29758101a3 Add symbol support to same_value function (#3030)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-02 13:52:53 +02:00
Robert Fancsik
ee1da14577 Optimize ecma_builtin_helper_def_prop. (#3007)
This patch removes the ecma_property_descriptor_t structure bitfields and substitutes it with an uint16_t flag field
to reduce the cost of the transformation from/into the ecma_property_flags_t.
Also the is_throw last arguments is embedded to the property descriptor structure during the property defining process to reduce the number of arguments of the function.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-27 18:28:03 +02:00
Robert Fancsik
d2931c6e40 Rework Map object (#2760)
This patch reworks the core of the builtin Map object.

Advantages:
 - Provide sublinear access time for the elements via Lcache and property hashmap
 - This implementation is suitable for the builtin Set object as well

Also add the missing 'forEach' routine for the builtin object as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-17 14:50:03 +02:00
Péter Gál
40f7b1c27f Rework usages/naming of configuration macros [part 1] (#2793)
There are quite a few configuration macros in the project.
As discussed in the #2520 issue there are a few awkward constructs.

Main changes:

* Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format.
* The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins.
* Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format.
* The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins.
* Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
* All options (in this change) can have a value of 0 or 1.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
  JERRY_REGEXP_STRICT_MODE is set to 0 by default.
* Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now
  it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point
  number.
  By default the 64-bit floating point number mode is enabled.
* All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to
  test if the feature is enabled or not.
* Added/replaced a few config.h includes to correctly propagate the macro values.
* Added sanity checks for each macro to avoid incorrectly set values.
* Updated profile documentation.
* The CMake feature names are not updated at this point.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-04-09 10:14:46 +02:00
Robert Fancsik
2dd854d28b
Ensure that ecma_get_number throws error for symbol values. (#2744)
This patch fixes #2743.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-02-07 16:07:35 +01:00
Robert Fancsik
7e3d688e5b Implement the Symbol builtin object (#2601)
This patch contains the base functionalities that the new builtin object requires.

Currently unavailable:
 - print (Symbol('foo')) - this features requires the refactor of the print handler function
 - Several global symbol based builtin routines (follow up patch)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-01-16 10:09:23 +01:00
László Langó
b4b0b7d572 Merged conditions of if statements where possible. (#2380)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-06-06 15:08:17 +09:00
László Langó
64b16bf190 Update Doxygen config file and fix Doxygen warnings (#2324)
A lot of warnings remained hibben because 'EXTRACT_ALL' was previously set to YES.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-05-18 15:43:17 +09:00
Akos Kiss
65ae949dc3 Add jerryscript-compiler.h public header to cover compiler incompatibilities (#2313)
In general, public headers should not have compiler-specific
constructs but both the core and the port headers have attributes,
which are non-standard. It's better to factor out such constructs
to a common place (a new header) and hide them behind macros, which
can then be defined on a per-compiler basis.

This patch moves the existing definitions of function attributes and
likely/unlikely builtins to the new header. At the same time, it
unifies the names of these attribute defines and where they are
used. Moreover, it touches on jerry-main and removes the uses of
`__attribute__((unused))` entirely and replaces them with the
elsewhere used `(void) ...` pattern.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-14 09:41:26 +09:00
Zoltan Herczeg
d60d4dbba9
Improve magic string handling. (#2221)
Remove unnecessary ref / deref calls when magic strings are used.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-03-01 13:31:15 +01:00
Zoltan Herczeg
06ebfc52ed Simplify ECMA_OP_TO_NUMBER_TRY_CATCH macro. (#2185)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-02-01 19:31:17 +09:00
Robert Sipka
bd574956e3 Fix conversion warnings (#2126)
NuttX and artik053 build - compiling with strict Werror=conversion - fail when jerry-debugger option is enabled.
This patch based on #2007, because most of them are fixed earlier within that PR, but it was closed before the land.

Credit: Piotr Marcinkiewicz p.marcinkiew@samsung.com

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2017-12-19 10:37:24 +01:00
Robert Fancsik
e83de3accd Remove ecma_simple_value_t and refactor ecma_make_simple_value (#2135)
This patch removes all ecma_make_simple_value calls to make the code more easy to understand.
Also removes the type ecma_simple_value_t which improves the performance in related code paths by calculating the value of new ecma_value_t is no longer needed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2017-12-06 18:06:07 +01:00
Levente Orban
4420401cf5 Style fix: return value comments (#1668)
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
2017-03-21 10:24:54 +01:00
Tilmann Scheller
0511091e8a Streamline copyright notices across the codebase. (#1473)
Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.

Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):

"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)

This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.

Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-12-08 06:39:11 +01:00
Robert Sipka
fb3e8cf8b8 Replace // double slash comments with /* */. (#1461)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-11-29 15:54:35 +01:00
László Langó
a130059c8b Add error messages to ecam/operations. (#1396)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-10-19 09:37:51 +09:00
Zoltan Herczeg
da02a37a02 Remove several ecma_op_object_get_[own_]property calls.
The ecma_op_object_get_[own_]property calls should be phased out from
the project eventually and virtual properties should be introduced instead.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-09-09 01:49:57 -07:00
István Kádár
a81c7c83d7 ecma_make_boolean_value(bool) function is added in order to make ecma_value form a raw bool.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-07-01 16:00:56 +02:00
László Langó
7f153c799a Improve empty checks of ecma strings
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-21 13:40:12 +02:00