Fix sweeping ecma_promise_value_thunk function objects (#4312)

Fixes #4214

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla 2020-10-29 10:50:37 +01:00 committed by GitHub
parent 72c92d6b36
commit e681adce05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -1319,6 +1319,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
case ECMA_NATIVE_HANDLER_VALUE_THUNK:
case ECMA_NATIVE_HANDLER_VALUE_THROWER:
{
ecma_free_value_if_not_object (((ecma_promise_value_thunk_t *) object_p)->value);
ext_object_size = sizeof (ecma_promise_value_thunk_t);
break;
}

View File

@ -0,0 +1,19 @@
// 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.
var called = false; Promise.resolve('d').finally((v) => called = true);
function __checkAsync() {
assert(called);
}