Although many Math built-in functions have a similar structure
these code paths were implemented as separate C functions.
After this patch only one common dispatcher remains which shares
the common code paths of different built-in functions. This
reduces the binary size by 1 Kbyte.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
It's generally considered a bad programming practice to have function declarations without parameter names.
This is another legacy from the early days of the project. Fix in one go to minimize history disruption.
Used a custom clang-tidy check to create the bulk of the change.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
Extern keywords on function declarations/definitions provide no additional value since function declarations/definitions default to external linkage in C99, e.g. removing them won't change the semantics of the program.
The extern keywords were essentially a legacy from the early days of the project. This commit cleans this up across the whole codebase in one go to minimize history disruption.
The bulk of the changes in this commit were produced by a custom clang-tidy checker.
Note that variables declarations carrying the extern keyword are untouched by this commit since there the presence of the keyword actually has an impact on the semantics of the program.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
Before this patch each built-in routine had a separate C
function. Although these functions shared a lot of common
operations compilers cannot eliminate these code duplications
in the final binary code. This patch introduces a single C
function which handles all date prototype routines. Each
shared code block has only one binary represenation.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Clarify that each contributed file needs to have a proper license header and that the addition of individual copyright notices is not permitted.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
The JSON parser required a zero terminated writable copy of
the original string. The requirement is eliminated from the
project to reduce peak memory consumption.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Update mbed OS target to latest version of mbed OS (5.2.3). Also rename all files in jerryscript-mbed-drivers/ to include -js.cpp, as our build tools now generate warnings for C++ files with the same name. mbed-events library is now mainlined, so no longer required to pull this library in as a separate dependency.
JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
Renamed FEATURE_PARSER_DISABLE to FEATURE_JS_PARSER.
Fixed the build error that occurred in case of disabled js-parser.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
We're building a REPL (as user-space program) on top of mbedos5 target. For this I need to override the jerry_port_console and jerry_port_log functions from the REPL. This commit wraps these functions in an ifndef, so we can define macros to not include these files.
JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
Remove the parser so we can save space if we are
only interested in running snapshots.
Removing the parser enables the snapshot execution.
JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
Furthermore the maximum number of properties is increased to 96.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Add a set of tests to ensure basic coverage of the ArrayBuffer built-in. Support for ArrayBuffer was added in #1467.
Closes#1475.
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
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
The ecma_date_make_day() handled any date in October on leap years incorrectly,
which was mentioned in issue #1836. The ecma_date_week_day() returned minus values
when return week_day before 1970 years which was also incorrect.
This change solves these bugs. In addition, this enhances the algorithm of accessing 'the ym-mn-1'
by replacing binary search to simple computation at ecma_date_make_day().
JerryScript-DCO-1.0-Signed-off-by: Hayun Lee lhy920806@gmail.com
Zephyr 1.6 switched to "unified kernel API". Old API is supported, but
deprecated and leads to warnings.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
mbed OS 5 target is currently missing wrappers around PwmOut and AnalogIn interface, which are part of the standard library of mbed OS. This commit adds them. Tested with mbed CI test shield. I've followed the coding style in jerryscript-mbed, rather than JerryScript coding style.
JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
In the mbedos5 target the setTimeout and setInterval functions are not on spec, as they return 'undefined' instead of an event ID. Also clearTimeout and clearInterval are not implemented, so scheduled events cannot be canceled. This patch changes the behavior of the set* functions, and implements clear* functions.
JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
Serial monitors (like screen on macOS / Linux) expect both CR and LF characters for new lines. Due to jerryscript only printing a line feed after calls to `print()` this makes log messages look wrong. This patch adds a CR when it encounters a LF character in jerry_port_console or jerry_port_log for the mbedos5 target.
JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
Property names were always required a string reference which consumed
a large amount of memory for arrays. This patch reduces this consumption
by directly storing the value part of certain strings.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Update URL to match the new repository location so the Travis CI badge will start working again.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
Update the LICENSE and README file to reflect that the project IP transfer from Samsung to the JS Foundation has been completed.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
This change allows easier access to array length which improves
the performance of inserting new items into an array and there
is no need to allocate length strings anymore. The trade-of is
that array length cannot be cached anymore.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com