The file `main-unix.c` contained a lot of recurring patterns in the
command line option handling parts. This patch removes these code
clones with the introduction of two helper functions. The goal of
the patch is to have a smaller and maintainable `jerry` tool (mostly
source-wise).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Disable release binary stripping on OSX: The linker of OSX does not
support `-s` for link-time stripping. (The option does not cause an
error but clutters build output with warnings.)
No OSX-dependent LTO flags: LTO is disabled on OSX.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This change is required to fix invalid links in 'See also' sections.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This change makes the generated snapshot independent from buildconfig.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
Some functions were incorrectly marked as const but were pure only
(or not even pure). Some functions were marked as pure but
qualified as const. Some functions were not attributed at all but
qualified either as pure or const. Some functions had attributes
at definition but not at declaration. This commit fixes these
inconsistencies.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Until now, it was not possible to query the engine whether its
build configuration contained debugging support. This commit adds
the `JERRY_FEATURE_DEBUGGER` label to `jerry_feature_t` and extends
`jerry_is_feature_enabled` to support the new feature flag.
Additionally, the command line tool `jerry` was enhanced to report
a warning when invoked with `--start-debug-server` but linked to a
non-debuggable engine.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This modification makes it possible to initialize a context in such a
way that a `void *` pointer is stored inside the context and is made
available via a new `jerry_get_user_context()` API.
The pointer is initialized via a new `jerry_init_with_user_context()`
API, which calls the existing `jerry_init()`, after which it sets the
value of the new `user_context` element in the `jerry_context_t`
structure using the context allocation callback provided as the second
parameter to the new `jerry_init_with_user_context()` API. The location
of the cleanup function responsible for deallocating the pointer created
by the context allocation callback is provided as the third parameter.
This location is stored in the context along with the pointer itself.
When a context is discarded via `jerry_cleanup()`, the user context
cleanup function is called to dispose of the pointer stored within the
context.
The semantics behind the API are such that it is now possible to choose
for each context an agent which manages arbitrary user data keyed to the
given context. The agent must be chosen at context instantiation time
and cannot be changed afterwards, remaining in effect for the lifetime
of the context.
Fixes#1717
JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
The arrays contain the addresses of functions annotated with
constructor or destructor attributes. The support is optional,
requires FEATURE_INIT_FINI cmake option to be set. As of now, the
option is _not_ available in tools/build.py directly, only via
`--cmake-param="-DFEATURE_INIT_FINI=ON"`.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The `jerry_port_jobqueue_enqueue` function is undefined on this target.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
Change instances of **.ext in the .gitignore to just *.ext. I think
the intent was to match these patterns in any directory, which is what
will happen with simple patterns. The '**' construct is meant to
match zero or more full paths, but it must be the sole component of
the path.
Discovered by a warning from ripgrep.
JerryScript-DCO-1.0-Signed-off-by: David Brown david.brown@linaro.org
Ecma-object have native handle type inside, and binding code could use
type info to validate native handle's type.
Related issue #1681
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
This check is performed in cmake-side too.
The README.md about the profiles is also updated.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
The ecma_typedarray_create_object_with_typedarray function is fully rewritten.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Change CONFIG_DISABLE_ES2015_ARRAYBUFFER_BUILTIN to
CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
Because typedarray depends on arraybuffer and it doesn't make sense to
enable arraybuffer only.
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
The `run-tests.py` test execution harness validates the correctness
of JerryScript by building various configurations of jerry and
running various test suites and subsets against it. However, until
now, it always built jerry for each (build configuration, test suite)
pair. This commit improves `run-tests.py` by skipping duplicate
builds, sharing the same-built binaries across multiple test suite
runs.
The patch also improves on the style of how `Option`s are specified
and fixes the name of the `jerry_tests-debug-cpointer_32bit`
option.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Job queue (event loop) is the basis of Promise. Each port should implement their own job queue.
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
Profiles used to be in alpha order. However, after the recent
`CONFIG_DISABLE_[ES2015_]*_BUILTIN` renamings, the minimal profile
became unsorted. This commit re-sorts the file.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
In the jerry_set_prototype part the method was described
as jerry_get_prototype. Minor typo fix.
The usage of jerry_set_property was incorrect. Each
call to the jerry_set_property returns a value which must be freed.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com