diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index 20bb1dd64c..0cfac9212e 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -1405,6 +1405,13 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */ { ecma_value_t super_prototype_value = ecma_op_object_get_by_magic_id (super_class_p, LIT_MAGIC_STRING_PROTOTYPE); + + if (ECMA_IS_VALUE_ERROR (super_prototype_value)) + { + result = super_prototype_value; + goto error; + } + if (ecma_get_object_type (super_class_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION && !ecma_is_value_object (super_prototype_value)) { diff --git a/tests/jerry/fail/regresssion-test-issue-3121.js b/tests/jerry/fail/regresssion-test-issue-3121.js new file mode 100644 index 0000000000..d6bc98e660 --- /dev/null +++ b/tests/jerry/fail/regresssion-test-issue-3121.js @@ -0,0 +1,17 @@ +// 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 Base = function ( ) { }.bind( ); +Object.defineProperty ( Base , 'prototype' , { get : function ( ) {$} } ); +class C extends Base { }