1125 Commits

Author SHA1 Message Date
Robert Fancsik
ec142f5ff6 Fix the Map builtin name property (#2648)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-12-19 13:00:54 +01:00
Zoltan Herczeg
83ee9cfca3 Fix named function expression creation. (#2634)
Create a local lexical environment with the name of the function. While
this is not too memory efficient, some corner cases requires its existence.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-12-12 12:50:03 +01:00
Robert Fancsik
4f0b075f85 Implement ES2015 {Array, %TypedArray%}.prototype.find routine (#2631)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-12-12 10:13:05 +01:00
Zoltan Herczeg
bc1b13dcb6 Fix floating number parsing. (#2628)
This patches fixes floating point number parsing when the number starts with dot.

Fixes #2614.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-12-01 17:22:39 +01:00
Robert Fancsik
24817b27f9 Optimize property call opcodes (#2609)
In with contexts the object base value must be resolved before executing a call operation.
Since this happens rarely the base resolving code paths has been seperated to an other VM opcode
so these extra checks do not burden the general property call steps.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-29 09:00:22 +01:00
Tóth Béla
8410570dd9 Seperate tests from test-api.c - Property (#2596)
Seperate the property based test from the `test-api.c` file.

JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2018-11-28 13:13:24 +01: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
Zoltan Herczeg
a0a6eaaee8
Support identifier references for object initializers. (#2597)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-11-22 10:07:11 +01:00
Daniel Balla
3d33d3258a Rename a regression test to match the issue number (#2613)
There was a typo in a regression test name, referencing to a different pull request rather than the issue it fixes.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-11-22 02:24:48 +01:00
Robert Fancsik
8e28316b1a Fix a typo in Object.getOwnPropertyNames test (#2612)
With the change the test file truly checks the corresponding part of the standard (ECMAScript v5, 15.2.3.4.1).

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-22 02:08:06 +01:00
Daniel Balla
f9e21540d6 Typo fixes related to jerry_json_stringify (#2611)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-11-22 02:05:34 +01:00
Robert Fancsik
49a0836daa Add missing ecma_free_value in ecma_builtin_promise_do_all (#2604)
This patch fixes #2602 and fixes #2603 as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-20 14:40:34 +01:00
Daniel Balla
704eb45cb8 [API] Add RegExp C API (#2542)
This patch supports creating a RegExp object through the C API.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-11-19 13:18:00 +01:00
Robert Sipka
47fa5904b1
Improve the evaluate requests (#2583)
Currently it evaluates the given expression in the context of the top most stack frame.
The expression should access to any variables and arguments that are in the scope chain.
Implement the eval_at request with the level of the scope chain as a further argument.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2018-11-15 15:53:10 +01:00
Robert Sipka
6c4b316609
[Debugger] Modify the object representation in case of variables request. (#2594)
Return with the object`s toString() method instead of create a json formated string from it.
It could have led to an error in previous cases (an object contains itself etc.)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2018-11-15 14:13:49 +01:00
Robert Fancsik
ecf385888f Disable class Array/%TypedArray%.prototype.{slice, map, concat, filter, splice} related tests (#2588)
This patch fixes #2587.
The reason of disabling these tests is that the current implementation slightly differs from the related part of the standard (ECMA-262 v6, 9.4.2.3.6.d.1).
This part requires the hidden Symbol.@@species property, hence this functionality has not been implemented yet in the project.
Also add the related test case to prevent further errors.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-09 09:42:16 +01:00
matedabis
74d474248d Enable the already fixed test cases (#2570)
Enable already fixed asserts

JerryScript-DCO-1.0-Signed-off-by: Mate Dabis mdabis@inf.u-szeged.hu
2018-10-31 09:53:21 +01:00
repasics
3c1d0e6100 Enable test cases (#2566)
Enable previously disabled test cases in math-pow.js. Everything works as expected.

JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi repasics@inf.u-szeged.hu
2018-10-30 15:25:54 +01:00
Tóth Béla
63e8287f2b Seperate tests from test-api.c - Strings (#2564)
`test-api.c` is contains testing for all API functions. This file is too big and hard to read. This patch moves the strings and string methods into a separate test file.

JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2018-10-30 11:42:54 +01:00
Zoltan Herczeg
83fc0aa04f Add support for function argument initializers. (#2571)
EcmaScript 2015 14.1.

Note: arrow functions with default arguments are not supported yet.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-10-30 10:48:35 +01:00
Robert Sipka
34c5e229ee List scope chain levels and their variables to the selected stack frame. (#2557)
It supports to list the scope chain of the current execution context and see
which variables are available.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2018-10-29 14:33:31 +01:00
Zoltan Herczeg
93567fbb8f Support methods for object initializers. (#2567)
MethodDefinition in ES-2015 12.2.6.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-10-26 23:47:08 +02:00
Robert Fancsik
d1860d0e34 Implement ES2015 class feature (part II.) (#2439)
This patch is the second milestone of the implementation of this new language element.

Supported:
 - Single class inheritance
 - Functionality of 'super' keyword
 - Implicit constructor in class heritage
 - Specific behaviour while extending with the built-in 'Array' or '%TypedArray%' object
 - Abstract subclasses (Mix-ins)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-10-25 16:00:48 +02:00
Zoltan Herczeg
e0e6363f85
Fix object initializer prescanning issues. (#2563)
This patch fixes incorrect syntax errors reported by the prescanner for
ES5.1 getter/setter property initializers and ES2015 computed properties.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-10-19 13:49:41 +02:00
Zoltan Herczeg
5060579b90 Fix double literal free. (#2535)
Fixes #2531.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-10-18 01:17:53 +02:00
crazy2be
3afc4b0b85 Change jerry_port interface to allow for a correct implementation of timezones. (#2540)
The previous jerry_port interface did not allow timezones to be handled correctly,
even if the host system was up to the task. This PR changes the jerry_port interface
to allow a completely correct implementation to exist, and provides one (for Linux/BSD
systems) in default-date.c.

Fixes #1661

JerryScript-DCO-1.0-Signed-off-by: crazy2be crazy1be@gmail.com
2018-10-18 00:58:18 +02:00
Akos Kiss
1393e9c3da
Remove the support for "N*.js"-named disabled tests (#2553)
The only such test was a legacy of the long removed compact
profile, which is also removed.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-10-08 13:48:39 +02:00
Zoltan Herczeg
d5a635a54a Fix use after free during creation of Promise reactions. (#2532)
The ecma_enqueue_promise_reaction_job() function allocates memory,
which might trigger a GC run. During this GC the objects in the
reactions collection are not marked.

Fixes #2486.
Fixes #2506.
Fixes #2541.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-10-05 08:08:41 +02:00
Robert Fancsik
abf22597e5 Add missing error check in ecma_builtin_promise_do_race (#2546)
Fixes #2544.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-10-03 11:39:43 +02:00
Daniel Balla
7717d2ee27 Change Promise properties to internal properties (#2526)
There was an issue in the Promise implementation where properties were accessible from JavaScript.
ie. `Object.defineProperty(Object.prototype, 0, {})` could modify properties which should've been inaccessible.
The reason behind that is somewhat interesting as 0-7 were the same values as the enum values in the property list of the Promise object.
Changing these properties to internal, makes them inaccessible from JS side.

Also some tests have been changed, namely 2490 and 2465.
The 2490 one got renamed, and all of the testcases from the issue have been added.
2465 got changed as well, since currently our Promise implementation can't display Promise errors, so we should check if an error is correctly returned.

Fixes #2490

Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-09-24 13:49:41 +02:00
Robert Fancsik
685d8b3675 Fix JERRY_CONTEXT (error_value) handling during ecma_builtin_promise_reject_abrupt (#2519)
Fixes #2489.

Co-authored-by: Daniel Balla <dballa@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-09-17 18:27:00 +02:00
Robert Fancsik
6c21c08b0e Fix ecma_op_function_list_lazy_property_names in case of arrow function (#2529)
Fixes #2528.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-09-17 13:31:17 +02:00
Akos Kiss
3d3a8008a8 Don't use strlen for string literals (#2517)
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
2018-09-17 10:07:24 +02:00
Peter Marki
0d05dfcd68 Remove bad assertion in ecma_builtin_json_str_helper (#2521)
Fixes #2494

JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2018-09-14 12:04:47 +02:00
Daniel Balla
8f64339e5f Fix ecma_op_object_put return value not being handled (#2514)
Fixes #2487
Fixes #2488

Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-09-06 21:05:37 +02:00
László Langó
99c9a22b78 Improve API of literal save and the snapshot (command line) tool (#2507)
Removed 'jerry_parse_and_save_literals' and introduced
'jerry_get_literals_from_snapshot' instead which works
on snapshot buffers rather than source code. Added literal
saving feature to snapshot merge in the snapshot command
line tool. Also added missing 'jerry_cleanup()' calls to the
snapshot tool. Improved the console messages of the snapshot
tool.

Based on previous work of Tamas Zakor <ztamas@inf.u-szeged.hu>

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-09-06 13:45:15 +02:00
Zoltan Herczeg
d3d42f7685 Implement the core of the map object. (#2447)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-09-04 13:30:00 +02:00
Daniel Balla
65e81f3262 Fix UTF8 string length calculation (#2508)
Fixes #2451
Fixes #2452
Fixes #2453

Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-09-04 10:47:28 +02:00
László Langó
8547380d46 Fix constantness of 'jerry_merge_snapshots' function. (#2504)
'jerry_merge_snapshots' should not modify the input snapshots. Updated the
related unit test. Also fixed some minor style issues.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-09-03 14:00:07 +02:00
Zoltan Herczeg
2ad883ea48
Fix logging issues in the debugger. (#2483)
- Properly handle logging during transport close
 - Properly display data during parse

Furthermore hide global functions of the debugger.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-09-03 11:14:57 +02:00
Daniel Balla
f5757e4c91 Fix ecma_builtin_promise_race_or_all function (#2491)
If a new Capability was created no check was issued if it happened to be an error.
Fixes #2465
Fixes #2468
Also fixes the second variant of #2490.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-08-31 16:45:32 +02:00
Akos Kiss
a2645601ae Remove character pointer typedefs (#2492)
The `[jerry|ecma]_char_ptr_t` types are some old legacy that are
used quite inconsistently. Their `[jerry|ecma]_char_t *` variants
are used a lot more often, so it's better to stick to one form
throughout the code base.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-08-30 09:33:05 +02:00
Zoltan Herczeg
bd42403600
Implement computed properties for object literals. (#2481)
Also disable ES5.1 property name dumplication checks
when ES2015 object literals are enabled.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-08-28 15:28:16 +02:00
Zoltan Herczeg
300e40ba9d
Improve python debugger client. (#2441)
Replace DisplayData to DebuggerAction. The new class has only four type
options. Furthermore several functions returning with DisplayData is
changed to return with string.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-08-22 17:34:32 +02:00
Anthony Calandra
b2cf7eb659 Add %TypedArray%.prototype.sort([ compareFunction ]) support. (#2437)
JerryScript-DCO-1.0-Signed-off-by: Anthony Calandra anthony@anthony-calandra.com
2018-08-22 08:49:12 +02:00
Akos Kiss
7639e613a4
Remove jerry-libc (#2332)
Rationale:
- There is no port under targets/ that would use it. All of them
  turn it off when building.
- That's no surprise, as jerry-libc supports no barebone MCUs but
  posix targets with syscalls only. Actually, that's Linux only,
  because macOS builds have turned off the use of jerry-libc a
  while ago.
- And there is no point in maintaining a highly restricted set of
  libc functions: as soon as someone wants to use JerryScript in a
  scenario that needs more functions than jerry-main, they have to
  choose a different libc (most problably the compiler's default
  one).

I think that we should not keep supporting an otherwise unused
library for the purposes of jerry-main on arm/x86/x64-linux  only.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-08-21 09:26:53 +02:00
Marc Jessome
cffeaba2a6 Fix syntax error when closing a block after a return statement (#2479)
This adds a right brace to the list of tokens that will end a return
statement.

JerryScript-DCO-1.0-Signed-off-by: Marc Jessome marc.jessome@fitbit.com
2018-08-21 13:51:40 +09:00
Akos Kiss
b52fff1f9d Distinguish between public and private headers in jerry-core (#2472)
The patch also ensures that all components access only the public
headers of other components (except for unit tests, which are
allowed to use private headers, too).

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-08-16 07:55:38 +09:00
Daniella Barsony
64051b5bd8 Add total frame counter to backtrace in debugger (#2428)
This was needed for the VScode extension so we know in total howmany frames we have in the backtrace.

JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2018-08-03 11:30:13 +02:00
Daniel Balla
87897849f6 Fix for null pointer dereference in jmem_heap_free_block (#2440)
Fixes #2435.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-08-01 23:09:30 +09:00