Skip to content

Commit 49a0836

Browse files
rerobikazherczeg
authored andcommitted
Add missing ecma_free_value in ecma_builtin_promise_do_all (#2604)
This patch fixes #2602 and fixes #2603 as well. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
1 parent 704eb45 commit 49a0836

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

jerry-core/ecma/builtin-objects/ecma-builtin-promise.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ ecma_builtin_promise_do_all (ecma_value_t array, /**< the array for all */
478478

479479
if (ECMA_IS_VALUE_ERROR (put_ret))
480480
{
481+
ecma_free_value (array_item);
481482
ret = put_ret;
482483
break;
483484
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
Object.defineProperty ( Array.prototype , 0 , { set : function ( ) { throw "MyError" } } ) ;
16+
Promise.all ( [ "2015-01-01" ] ) ;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
16+
Object.defineProperty( Array.prototype, 0, { set : function ( ) { throw "MyError" } } );
17+
Promise.all( [ .86456 ] ) ;

0 commit comments

Comments
 (0)