Remove ES_NEXT macro (#4915)
- remove all '#JERRY_ESNEXT' macro - remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default) - move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names - add skiplist to some snapshot tests that were supported only in 5.1 - fix doxygen issues that were hidden before (bc. of es.next macro) Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -189,3 +189,45 @@ var value = array.slice(1, {
|
||||
})
|
||||
|
||||
array_check(value, []);
|
||||
|
||||
// Constructor creates longer array than expected.
|
||||
class LongArray extends Array {
|
||||
constructor(len) {
|
||||
super (42);
|
||||
this.fill ("foo");
|
||||
}
|
||||
}
|
||||
|
||||
var a = new LongArray (5);
|
||||
a.length = 5;
|
||||
var sliced = a.slice ();
|
||||
assert (sliced.length == 5);
|
||||
assert (JSON.stringify (sliced) == '["foo","foo","foo","foo","foo"]')
|
||||
|
||||
// Constructor creates shorter array than expected.
|
||||
class ShortArray extends Array {
|
||||
constructor(len) {
|
||||
super (2);
|
||||
this.fill ("bar");
|
||||
}
|
||||
}
|
||||
|
||||
var b = new ShortArray (8);
|
||||
b.length = 8;
|
||||
b.fill ("asd", 2);
|
||||
var sliced2 = b.slice ();
|
||||
assert (sliced2.length == 8);
|
||||
assert (JSON.stringify (sliced2) == '["bar","bar","asd","asd","asd","asd","asd","asd"]');
|
||||
|
||||
// Constructor creates array of the expected size.
|
||||
class ExactArray extends Array {
|
||||
constructor(len) {
|
||||
super (len);
|
||||
this.fill ("baz");
|
||||
}
|
||||
}
|
||||
|
||||
var c = new ExactArray (5);
|
||||
var sliced3 = c.slice();
|
||||
assert (sliced3.length == 5);
|
||||
assert (JSON.stringify (sliced3) == '["baz","baz","baz","baz","baz"]');
|
||||
|
||||
Reference in New Issue
Block a user