Skip to content

Commit ee267e8

Browse files
rerobikaLaszloLango
authored andcommitted
Add missing ecma_deref_ecma_string in ecma_builtin_typedarray_prototype_join (#2701)
This patch fixes #2698. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent 9ced3ad commit ee267e8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ ecma_builtin_typedarray_prototype_join (ecma_value_t this_arg, /**< this argumen
10271027
ecma_value_t next_string_value = ecma_op_typedarray_get_to_string_at_index (obj_p, k);
10281028
if (ECMA_IS_VALUE_ERROR (next_string_value))
10291029
{
1030+
ecma_deref_ecma_string (return_string_p);
10301031
ecma_free_value (first_value);
10311032
ecma_free_value (separator_value);
10321033
ecma_free_value (length_value);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
try {
16+
Uint8Array.prototype.join.call([ "2015-01-01T00:", { toString : '2,1,3,4,0' } ], [ ]) ;
17+
assert (false);
18+
} catch (e) {
19+
assert (e instanceof TypeError);
20+
}

0 commit comments

Comments
 (0)