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
MSVC doesn't support C99 VLA (variable-length array).
Use fixed size arrays in API examples and use JERRY_VLA macro
in unit tests to make these tests buildable on Windows too.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
MSVC doen't support __attribute__((unused)),
we should use JERRY_UNUSED macro instead.
Additionally removed the internal jrt.h include from
tests/unit-core/test-common.h which was layering violation.
It made JERRY_ASSERT unavailable, we should use TEST_ASSERT.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Added a unit test for the jerryx_arg_js_iterator_restore function.
Added the specification to the documentation.
JerryScript-DCO-1.0-Signed-off-by: Timothy Harvey t-harvey@ti.com
Their length (size) is known at compile time. Therefore `sizeof`
is more efficient for them.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Remove jerry_parse_named_resource, merge its arguments to jerry_parse
and change is_strict argument to an option list for possible future extensions.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Add a function in jerryx/arg.
jerryx_arg_transform_object_properties, it will validate the properties of a JS object, and convert those properties into native type.
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
In case of some compilers (e.g. gcc-4.9, gcc-5.4) the `TEST_ASSERT (arg3[4] == '\0')`
fails in test_validator1_handler() due to uninitialized memory fields.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
It provides some APIs for binding developers, so that
they can validate the type of the js argument and convert/assign them
to the native argument.
Related Issue: #1716
JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com