Skip to content

Commit 3c1c502

Browse files
Signevior of skipping null values during array processing, which was
inconsistent with the mainstream js engine behavior, has been removed JerryScript-DCO-1.0-Signed-off-by: tangbin [email protected]
1 parent 5020015 commit 3c1c502

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

jerry-core/vm/opcodes.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,6 @@ opfunc_append_to_spread_array (ecma_value_t *stack_top_p, /**< current stack top
326326

327327
for (uint32_t i = 0, idx = old_length; i < values_length; i++, idx++)
328328
{
329-
if (ecma_is_value_array_hole (stack_top_p[i]))
330-
{
331-
continue;
332-
}
333-
334329
if (stack_top_p[i] == ECMA_VALUE_SPREAD_ELEMENT)
335330
{
336331
i++;

tests/jerry/array-concat.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright JS Foundation and other contributors, http://js.foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// This test will not pass on FLOAT32 due to precision issues
16+
17+
var a;
18+
var foo = function(it) {
19+
a = [...it, , ];
20+
};
21+
var array = [1, 2];
22+
foo(array);
23+
assert (a.length == 3);
24+
assert (a[0] == 1);
25+
assert (a[1] == 2);
26+
assert (a[2] == undefined);

0 commit comments

Comments
 (0)