76 Commits

Author SHA1 Message Date
Zoltan Herczeg
3d797b8836 Implement the core of let/const statement. (#3239)
This patch implements the core part of let/const statements. Redeclarations are correctly
detected and separate contexts are correctly created for these statements. Register
optimizations are also emplyed whenever possible.

Lots of features are still missing:
 - checking the var statements in eval
 - const are treated as lets
 - single statement checks are missing
 - export declarations are exported as vars, let/const export is not supported

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-10-25 18:08:10 +02:00
Csaba Repasi
5533b8ba9b Add new tests (#2578)
Added tests/jerry/unusual.js to test corner cases
Added tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-008.js (a new test of instanceof)
Added new floatingpoint test case to tests/jerry/arithmetics-2.js
Added new test case to tests/jerry/arithmetics-bignums.js

JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi repasics@inf.u-szeged.hu
2018-11-22 10:10:37 +01:00
Zidong Jiang
0bc4bb056d Fix promise thenable bug
Related Issue: #2060

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-10-27 18:37:58 +09:00
Sanggyu Lee
c1cff3f961 Fix new ArrayBuffer(length) for variaous input (#1959)
Currently new ArrayBuffer(length) does not conform to ES2017.
Major JS implementations follow ES2017 for ArrayBuffer(length).

For example, new ArrayBuffer(length) should not throw RangeError
for length = NaN, undefined, negative number, floating point, and so on.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-08-16 18:20:41 +08:00
Sanggyu Lee
af16a3ae1a Implement typedarary.set(array, offset)
JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-08-11 14:38:37 +09:00
Zidong Jiang
078f6e101d Implement other routines of Promise (#1729)
Add Promise.resolve, Promise.reject, Promise.race, Promise.all and
Promise.prototype.catch

Also it fixes the issue 1763

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-04-26 19:47:51 +08:00
Zidong Jiang
eb8dd4602b Implement the basic Promise (#1695)
Implement the Promise Constructor and routine: 'then'

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-04-12 22:10:08 +08:00
Zoltan Herczeg
13b305f716 Refactoring several array buffer and typed array functions. (#1715)
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
2017-04-07 11:20:03 +02:00
Zidong Jiang
8571ebfae5 Implement %TypedArray%.from and fix the issue #1670 (#1679)
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-03-24 10:37:22 +01:00
Akos Kiss
e66bb5591d Implement Object.setPrototypeOf from ES2015 specification (#1666)
`Object.prototype.__proto__` has been implemented by most JS
engines to give R/W access to prototype chains, well before it made
it into the standard. JerryScript has decided not to implement it,
exactly because it was not part of ES 5.1. The only fully
ES5.1-compatible way of accessing the prototype chain is
`Object.getPrototypeOf` for reading.

However, ES2015 defines `Object.setPrototypeOf` for rewriting the
prototype chain, and JerryScript has now an ES2015 subset profile.
So, this commit adds its implementation to JerryScript.

Note, this commit does _not_ add `Object.prototype.__proto__`,
since that is in the Annex B of ES2015 specification, which is
optional for non-web-browser hosts.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-03-21 10:11:07 +01:00
Zidong Jiang
b13f78f19e Check options in ecma_op_object_get_own_property for typedarray. (#1627)
And add regression-case subfolder for es2015

Fix issue #1622

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-03-06 19:07:02 +08:00
Zidong Jiang
df4064c18e Implement ecma_object_get_class_name for all ES2015 builtin object (#1617)
Fix issue #1613

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-02-27 09:12:31 +01:00
Zidong Jiang
4727202c8e Add typedarray routine:reverse (#1585)
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-02-16 18:32:13 +01:00
Zidong Jiang
64a340ffeb typedarray routine: filter (#1581)
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-02-15 19:20:15 +01:00
Zidong Jiang
24e6c3f062 Add typedarray routine: reduce and reduceRight (#1569)
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-02-10 13:36:00 +01:00
Zidong Jiang
7b01b29ec8 Add typedarray routine: every, some, foreach, and map (#1566)
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-02-09 08:49:00 +01:00
Zidong Jiang
0547b31c16 [ES2015][TypedArray] add other 8 types (#1532)
Add Uint8Array, Int16Array Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array and Uint8ClampedArray. Support the conversion between any pairs of those types.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-01-24 15:06:31 +01:00
Zidong Jiang
adfe61b4ed [ES2015 profile]add TypedArray intrinsic object (#1507)
* add %TypedArray% intrinsic object
* implement Int8Array
* will implement other types and prototype functions
in the following patches.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-01-13 11:04:34 +01:00
Zidong Jiang
551aaa58e6 Fix unchecked size number conversion in ArrayBuffer (#1479)
Free_value after ecma_op_to_number and a related test file.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-12-09 14:54:34 +01:00
Zidong Jiang
fb2edd8556 Add ArrayBuffer regression tests (#1477)
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
2016-12-09 08:04:49 +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
Akos Kiss
9d4f7c917f Fixing Math.pow
The Math.pow implementation relies on libm's pow. However, the ISO C
and ES5.1 standards differ on pow:
  * `x ** NAN` is NAN in ES but `+1 ** y` is 1 in C
  * `+-1 ** +-INF` is NAN in ES but 1 in C

This patch:
  * Modifies the Math.pow implementation to handle the special cases
    instead calling pow.
  * Adds a test case to jerry-test-suite as it did not test
    `Math.pow(1,NaN)`.
  * Fixes jerry-libm's pow, as it was not standard conforming, which
    helped hiding the error in Math.pow.
  * Updates the unit test for libm.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-08-11 22:49:36 +02:00
Robert Sipka
f15e7beadc Remove compact profile.
The standard doesn't defines ECMAScript Compact Profile as a subset of Ecma-262 Edition 5.1.
Profile modes can be added easily like the minimal profile if required.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-08-05 09:11:33 +02:00
László Langó
1938415b0d Remove 'test-js-precommit' target from Makefile
When performing `make precommit`, instead of running only a subset of
the Jerry Test Suite on full profile builds, run the whole suite, and
also run the compact subset of the suite on compact builds. Also, make
CI perform the same tests.

Related issue: #879
Related PR: #912

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-05-17 15:42:27 +02:00
László Langó
9d7978074f Fix 'jerry-test-suite/13/13-011.js' fail in compact profile
Arguments object is not supported in compact profile, so remove
the test from 'compact-profile-list'. Do not create arguments
object on function calls in compact profile. Remove unnecessary
arguments check.
Related issue: #879

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-22 14:35:37 +01:00
Akos Kiss
f959ba95a4 Refactoring the build system
* Removed unused or unnecessary parts from various make files
* Eliminated lots of duplications from Makefile with the help of
  macros.
* Split tools/precommit.sh to its independent components:
  * the part that checks the existence of the "signed off" text in
    commit messages
    (this on got factored out to tools/check-signed-off.sh),
  * the part that uses vera++ for style checking (this one got
    factored out to tools/check-vera.sh),
  * the part that invokes targets in the cmake-generated build
    directory, and
  * the part that performs various tests (these latter two got
    moved into the Makefile).
* Moved the functionality of precommit-full-testing.sh into the
  Makefile, too.
* Added ninja build system support (e.g., `make NINJA=1`).
* Updated leading documentation comments (they were somewhat
  stale).
* Tried to keep the target names exactly the same as they were --
  almost succeeded... (some changes are intentional, and are
  subject to personal preferences).
* Simplified console output of `make precommit`
* Unified test runner scripts and their output format
  * Eliminated nothing-to-stdout everything-to-log-file policy:
    info is printed to stdout and it is the caller's
    responsibility to redirect it to a file if needed.
  * Also applied some renaming and coding style unification to
    the scripts.
* Merged the functionality of tools/runners/run-test-suite-jerry*.sh
  into the Makefile
* Merged everything related to a test suite execution in a single
  script.
  * The new script also allows to specify pass and xfail tests in
    a single list file, which was not possible hitherto.
  * Also, the paths of the test cases given in a file are
    interpreted relative to their container files.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-02-15 18:05:01 +01:00
László Langó
fec49f5f9a Update precommit test file list to run all test files.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-01-22 13:26:37 +01:00
chunseok lee
cb0087b517 remove 15.07.04.02-002.js from jerry-test-suites
Number.prototype.toString([radix]) is implementation-dependant.

JerryScript-DCO-1.0-Signed-off-by: chunseok lee chunseok.lee@samsung.com
2015-12-02 12:31:59 +03:00
Akos Kiss
ab68d093e8 Whitespace cleanup: tab removal in tests directory
Also changed space-based indentation in touched files if they used
4 spaces for indentation (instead of the most-often-used 2).

Also added new line to end of touched files if they did not end
that way.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2015-11-28 21:47:37 +01:00
Ruben Ayrapetyan
c715a7cd1d Change 'assert' handle to pass only upon exactly 1 argument is received, and the argument is boolean true; update internal test suite correspondingly.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-30 17:05:26 +03:00
Ruben Ayrapetyan
8b28cac99e Implementing escape sequences support with the exception of "\0" ("<NUL>") character and cases that depend on Unicode support.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-29 14:03:11 +03:00
Ruben Ayrapetyan
77df022468 Adding jerry-test-suite tests on Arguments object to precommit testing and removing them from unsupported list.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-28 19:12:54 +03:00
Ruben Ayrapetyan
7c488ea11a Fixing tests of internal test suite. 2014-11-06 17:47:36 +03:00
Ruben Ayrapetyan
e33e6a77cb Adding tests that depend on number precision to tests/jerry-test-suite/precommit_test_list. 2014-10-31 21:29:30 +03:00
Ruben Ayrapetyan
4d04cb4658 Removing tests that depend on features, which are unsupported in Compact Profile minimal build, from tests/jerry-test-suite/compact_profile_list list. 2014-10-31 21:05:41 +03:00
Ruben Ayrapetyan
05cf2dbe04 Providing cp_minimal build mode.
In the mode built-in objects except Global, Object, Object.prototype, Function,
Function.prototype, [[ThrowTypeError]] and CompactProfileError are disabled.

Making default builds (without cp cp_minimal modes set) to not define CONFIG_ECMA_COMPACT_PROFILE.
Removing some tests that depend on 'eval'-like functionality or CompactProfileError built-in from pre-commit testing.
2014-10-31 18:37:55 +03:00
Ruben Ayrapetyan
bf9ef27e2f Removing two tests that fail because of float32 precision limitations from tests/jerry-test-suite/precommit_test_list. 2014-10-24 20:39:41 +04:00
Ruben Ayrapetyan
0016adf957 Revert "Removing three tests that fail because of float32 precision limitations from tests/jerry-test-suite/precommit_test_list."
This reverts commit 7761650a96460ab39381d3b8983132b05364a489.
2014-10-24 20:38:41 +04:00
Ruben Ayrapetyan
ed32abb011 Removing three tests that fail because of float32 precision limitations from tests/jerry-test-suite/precommit_test_list. 2014-10-24 20:29:29 +04:00
Ruben Ayrapetyan
33aeac458a Removing tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-002.js and tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-003.js from tests/jerry-test-suite/float_precision_exceptions_list. 2014-10-23 15:46:46 +04:00
Ruben Ayrapetyan
ae048a7630 Running internal test suite during precommit testing. 2014-10-20 21:45:21 +04:00
Ruben Ayrapetyan
a8ed76591a Removing tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-002.js that depends on
TypeErro built-in support from CompactProfile-compatible test list (tests/jerry-test-suite/compact_profile_list)
and adding it to tests/jerry-test-suite/unsupported_list.
2014-10-20 17:31:41 +04:00
Ruben Ayrapetyan
1796138a27 Fixing some tests from internal test suite. 2014-10-20 17:31:41 +04:00
Ruben Ayrapetyan
3f54dc16e0 Removing tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-003.js that depends on String.prototype.indexOf support from
CompactProfile-compatible test list (tests/jerry-test-suite/compact_profile_list)
and adding it to tests/jerry-test-suite/unsupported_list.
2014-10-20 17:31:40 +04:00
Ruben Ayrapetyan
9c20969cfc Fixing some tests from internal test suite. 2014-10-20 17:31:40 +04:00
Ruben Ayrapetyan
c7f1e6b007 Adding three tests that depend on Number.prototype.toString support to tests/jerry-test-suite/unsupported_list and removing them from CompactProfile compatible tests list (tests/jerry-test-suite/compact_profile_list). 2014-10-20 17:31:40 +04:00
Ruben Ayrapetyan
f666750ce7 List of internal tests suite's tests that are not excluded by Compact Profile. 2014-10-20 14:38:41 +04:00
Ruben Ayrapetyan
ba4dca2e98 Fixing some tests from internal test suite. 2014-10-20 14:15:01 +04:00
Ruben Ayrapetyan
69a1cab26b Update unsupported_list: removed 'float32 precision' block and added 'other built-ins' block. 2014-10-20 13:55:49 +04:00
Ruben Ayrapetyan
03df80efe0 Fixing a test from internal test suite. 2014-10-16 21:46:37 +04:00