Skip to content

Commit b73100d

Browse files
authored
Add missing release value call to Array.prototype.pop fast path. (#3535)
This patch fixes #3534. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent e693854 commit b73100d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ ecma_builtin_array_prototype_object_pop (ecma_object_t *obj_p, /**< array object
428428
{
429429
if (!ecma_get_object_extensible (obj_p))
430430
{
431+
ecma_free_value (get_value);
431432
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));
432433
}
433434

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
var array = [$, Infinity]
16+
Reflect.preventExtensions(array);
17+
18+
try {
19+
var $ = array.pop()
20+
assert(false);
21+
} catch (e) {
22+
assert(e instanceof TypeError);
23+
}

0 commit comments

Comments
 (0)