45 Commits

Author SHA1 Message Date
Zoltan Herczeg
ae1118293f Add two new API functions: jerry_create_number_infinity and jerry_create_number_nan
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-08-14 23:20:50 -07:00
Akos Kiss
a2d5acb43c Follow-up refactoring of logging-related parts
This patch:
* Ensures that all calls to `jerry_port_log` in jerry-core happen
  via macros defined in jrt.h. Also, it unifies the names of those
  macros: as `JERRY_ERROR_MSG` and `JERRY_WARNING_MSG` gave a good
  pattern that was well aligned with the naming scheme of the log
  level enum, `JERRY_DLOG` and `JERRY_DDLOG` were rewritten to
  `JERRY_DEBUG_MSG` and `JERRY_TRACE_MSG`.
* Ensures that all debug logging code parts of jerry-core (i.e.,
  memory statistics, JS byte-code dumps, and RegExp byte-code
  dumps) are guarded by macros: `JMEM_STATS`,
  `PARSER_DUMP_BYTE_CODE`, and `REGEXP_DUMP_BYTE_CODE`, which in
  turn are controled by cmake build system feature flags
  `FEATURE_MEM_STATS`, `FEATURE_PARSER_DUMP`, and
  `FEATURE_REGEXP_DUMP`.
* Ensures that all debug logging functionalities can be controled
  during run time (provided that they were enabled during build
  time): the engine has `JERRY_INIT_MEM_STATS[_SEPARATE]`,
  `JERRY_INIT_SHOW_OPCODES`, `JERRY_INIT_SHOW_REGEXP_OPCODES` init
  flags, and the default unix/linux command line app has
  corresponding command line switches.`
* Drops `FEATURE_LOG`, `JERRY_ENABLE_LOG`, and
  `JERRY_INIT_ENABLE_LOG`, as their name was misleadingly general,
  even though they mostly controled the regexp engine only. The
  above-mentioned `*REGEXP*` things mostly act as their
  replacements.
* Updates build, test, and measurement tool scripts, and
  documentation.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-08-11 22:00:12 +02:00
László Langó
f0fd939d87 Move log level to default port
Setting the log level should be specified by the actual port.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-15 09:13:16 +02:00
László Langó
fa94c67ee7 Implement IO port API
Related issue: #964

Implemented the IO API of Jerry ports. Removed log file from API level.
The port implementation should define the destination of log messages.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-14 13:15:30 +02:00
László Langó
b4bba2ef70 Update API reference to the new API
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-12 14:08:59 +02:00
László Langó
9bce5b09a9 Update Jerry API
* Removed jerry_string_t and jerry_object_t
* Updated function names
* Updated return values
* Updated function descriptions
* Added new functions
* Added new unittests

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-11 09:01:29 +02:00
László Langó
c3541c3ab7 Check error values in API functions
Internal functions cannot handle error values, so it must be avoided to
pass error values to the engine.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-29 14:26:55 +02:00
László Langó
388b442d10 Update API reference
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-24 13:54:23 +02:00
László Langó
cfa0c94697 Add new API function
Implemented 'jerry_is_array' and 'jerry_get_array_length' API functions.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-24 10:08:17 +02:00
László Langó
65542549af Add conversion API functions
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-16 14:13:06 +02:00
László Langó
8e8504244b Update jerry API
* Fix error handling (related issue: #1141)
 * Move output paramters to the end of the arguments lists

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-16 13:43:33 +02:00
László Langó
a816ab8bb0 Use 'ecma_value_t' in API too
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-14 14:44:02 +02:00
László Langó
824d39c2a2 Update API functions
* Rename 'jerry_api_' prefix to 'jerry_'
 * Fix minor style issues
 * Group the API functions and add comment to each group
 * Move engine behaviour related funtions to 'jerry.h'

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-08 12:48:47 +02:00
Akos Kiss
3a8d3b3bcc Unifiy the comments of preprocessor conditionals
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-18 19:20:49 +02:00
François Baldassari
7b047d4b20 Add acquire_value API to simplify caller code
JerryScript-DCO-1.0-Signed-off-by: François Baldassari francois@pebble.com
2016-03-11 09:57:40 -08:00
Akos Kiss
25b0750756 Fix problems arising from incorrect use of various size types
E.g.,
* `ssize_t` was used where `lit_utf8_size_t` or `jerry_api_size_t`
  would have been correct,
* `lit_utf8_size_t` was used where `ecma_length_t` would have been
  correct.

Note, the patch also includes internal and public API changes:
* `ecma_string_to_utf8_string` does not return negative value if
   output buffer is not large enough to contain the string; the
   buffer is expected to be large enough. (`ecma_string_get_size`
   can be used to retrieve the required size.)
* `jerry_api_string_to_char_buffer` adapts the same logic (and
  `jerry_api_get_string_size` can be used to determine the
  required size of the buffer).

Related issue: #942

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-03-08 15:22:07 +01:00
László Langó
a187e6d60c Print error messages to be more informative
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-03-07 12:02:05 +01:00
László Langó
a0bedaa43d Remove EXTERN_C macros and use block based solution
Related issue: #900

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-19 15:45:14 +01:00
Robert Sipka
80811c8332 Warning fixes.
ISO C99 doesn’t support unnamed structs/unions.
Comparison of distinct pointer types lacks a cast.
Dereferencing type-punned pointer will break strict-aliasing rules.
Type of bit-field ‘ext’ is a GCC extension.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-02-16 13:56:07 +01:00
László Langó
b1acf1a562 Style fix: align pointer dereference operator to right
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-05 13:06:34 +01:00
István Kádár
636ded489f JerryScript api improvemts accordign to jerry_api_value_t struct.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-01-13 18:45:52 +03:00
Ilyong Cho
1c21e16c7b Adding Jerry api for triggering gc.
JerryScript-DCO-1.0-Signed-off-by: Ilyong Cho ily.cho@samsung.com
2015-12-02 12:26:07 +03:00
pius.lee
ece246ef9e Add foreach function for inquiry properties into obj
JerryScript-DCO-1.0-Signed-off-by: pius.lee pius.lee@samsung.com
2015-12-02 12:20:12 +03:00
Ruben Ayrapetyan
b7c93f170d Remove argument names in function prototypes, declared in headers; fix '*' alignment in headers.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-09-28 18:27:10 +03:00
Andrey Shitov
311cc65b33 Implement snapshot functionality.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-09-09 18:07:24 +03:00
chunseok lee
d31eb3c4cb Jerry API for array creation and manipulation
1. jerry_api_create_array_object : create array object of given size
2. jerry_api_set_array_index_value : set value at given index
3. jerry_api_get_array_index_value : get value at given index

JerryScript-DCO-1.0-Signed-off-by: chunseok lee chunseok.lee@samsung.com
2015-08-11 15:02:56 +09:00
Andrey Shitov
fd9ff8e3bd Add core unicode functionality.
Add utf-8 processing routines.
Change ecma_char_t from char/uint16_t to uint16_t.
Apply all utf-8 processing routines.
Change char to jerry_api_char in API functions' declarations.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
Andrey Shitov
c4b0cd2196 Change ecma_length_t and jerry_api_length_t from uint16_t to uint32_t.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
Ruben Ayrapetyan
06dffdec8f Remove exit completion value type.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-29 10:24:18 +03:00
SaeHie Park
723924f36f New External Magic String API to save heap memory
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-06-09 07:50:43 +09:00
Ilyong Cho
0c058747f1 Implemented jerry_api_create_error()
JerryScript-DCO-1.0-Signed-off-by: Ilyong Cho ily.cho@samsung.com
2015-05-20 19:59:46 +09:00
Andrey Shitov
9763a93df3 Add new coding style rules and fix appeared issues.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-05-14 14:44:57 +03:00
SaeHie Park
da86a52fe9 Fix object free callback.
- remove jerry_set_object_free_callback()
- change jerry_api_set_object_native_handle() with object_free_callback
- related issue: https://github.com/Samsung/jerryscript/issues/17

JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-05-10 17:55:26 +09:00
SaeHie Park
5ec3e2f59a Native callback in embedding jerry when object is to be freed.
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-05-04 19:59:58 +09:00
Ruben Ayrapetyan
cde7805356 Interface jerry_api_eval for performing eval operation. 2015-04-18 21:48:57 +03:00
Ruben Ayrapetyan
18079fb4d3 Implementing API for invocation of a function object as a constructor. 2015-04-10 09:55:04 +03:00
Ruben Ayrapetyan
469ef4e622 Implementing API for associating native handle (uintptr_t) values with JS objects. 2015-04-07 13:01:01 +03:00
Ruben Ayrapetyan
6594a7359b Supporting return values in functions of plugins. 2015-04-07 12:42:55 +03:00
Ruben Ayrapetyan
83730cd6bb Implementing dispatcher for calling native handlers associated with external function objects; implementing interface for unified storage of native pointers in ecma objects. 2015-04-03 23:38:52 +03:00
Ilyong Cho
23ade8f4ff wip: Implementing external function api 2015-04-03 18:11:21 +09:00
Ruben Ayrapetyan
eb3686a49d Adding jerry_api_is_constructor interface that check if specified object is a function object that implement [[Construct]] method; changing jerry_api_is_function to recognize bound and built-in functions; optimizing jerry_api_call_function. 2015-04-01 12:39:29 +03:00
Ilyong Cho
3c2009d331 Adding Jerry api for calling function with specific this binding. 2015-04-01 11:06:20 +09:00
Ruben Ayrapetyan
33cfaa73b3 Implementation of unimplemented Jerry API parts; adding Jerry API unit test based on test prepared by Ilyong. 2015-03-30 20:54:55 +03:00
Ilyong Cho
cf5e158510 Implement some Jerry API / jerry_api_call_function() and jerry_api_get_object_field_value() 2015-03-30 16:04:49 +09:00
Ruben Ayrapetyan
9746b2fd76 Jerry API for calling functions C -> Jerry, creating objects, reading / writing object's properties (currently, only interface declaration, without implementation). 2015-03-27 18:05:27 +03:00