mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
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 frobert@inf.u-szeged.hu
This commit is contained in:
parent
9ced3addaa
commit
ee267e8aa9
@ -1027,6 +1027,7 @@ ecma_builtin_typedarray_prototype_join (ecma_value_t this_arg, /**< this argumen
|
||||
ecma_value_t next_string_value = ecma_op_typedarray_get_to_string_at_index (obj_p, k);
|
||||
if (ECMA_IS_VALUE_ERROR (next_string_value))
|
||||
{
|
||||
ecma_deref_ecma_string (return_string_p);
|
||||
ecma_free_value (first_value);
|
||||
ecma_free_value (separator_value);
|
||||
ecma_free_value (length_value);
|
||||
|
||||
20
tests/jerry/es2015/regression-test-issue-2698.js
Normal file
20
tests/jerry/es2015/regression-test-issue-2698.js
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright JS Foundation and other contributors, http://js.foundation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
try {
|
||||
Uint8Array.prototype.join.call([ "2015-01-01T00:", { toString : '2,1,3,4,0' } ], [ ]) ;
|
||||
assert (false);
|
||||
} catch (e) {
|
||||
assert (e instanceof TypeError);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user