Skip to content

Commit dc837d2

Browse files
authored
Fix incorrect assertion on ecma_op_function_has_instance (#3827)
This patch fixes #3814. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent 9ceece8 commit dc837d2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Diff for: jerry-core/ecma/operations/ecma-function-object.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,8 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
641641
}
642642

643643
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION
644-
|| ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
644+
|| ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION
645+
|| ECMA_OBJECT_IS_PROXY (func_obj_p));
645646

646647
ecma_object_t *v_obj_p = ecma_get_object_from_value (value);
647648

Diff for: tests/jerry/es2015/regression-test-issue-3814.js

+17
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+
function f () {}
16+
17+
assert((new f) instanceof new Proxy(f, {}))

0 commit comments

Comments
 (0)