소스 검색

LibJS: Forward BoundFunction::has_constructor() to bound target function

A BoundFunction only implements [[Construct]] (has_constructor() in
LibJS) if its bound target function does.
Linus Groh 3 년 전
부모
커밋
72f5252826
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Userland/Libraries/LibJS/Runtime/BoundFunction.h

+ 1 - 1
Userland/Libraries/LibJS/Runtime/BoundFunction.h

@@ -23,7 +23,7 @@ public:
     virtual FunctionEnvironment* new_function_environment(Object* new_target) override;
     virtual const FlyString& name() const override { return m_name; }
     virtual bool is_strict_mode() const override { return m_bound_target_function->is_strict_mode(); }
-    virtual bool has_constructor() const override { return true; }
+    virtual bool has_constructor() const override { return m_bound_target_function->has_constructor(); }
 
     FunctionObject& bound_target_function() const { return *m_bound_target_function; }
     Value bound_this() const { return m_bound_this; }