Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2016년 9월.
handler.construct() 메서드는 new 연산자에 대한 트랩입니다. 결과 Proxy 객체에서 new 연산이 유효하려면 프록시를 초기화하는 데 사용되는 대상 객체 자체에 내부 [[Construct]] 메서드가 있어야 합니다(즉, new target이 유효해야 함).
다음 매개변수는 construct() 메서드에 전달됩니다. this는 처리기에 바인딩됩니다.
target대상 객체.
argumentsList생성자의 인수 목록.
newTarget원래 호출된 생성자. p 위.
construct 메서드는 반드시 객체를 반환합니다.
handler.construct() 메서드는 new 연산자에 대한 트랩입니다.
이 트랩은 다음 작업을 가로챌 수 있습니다.
다음 불변 조건이 위반되면 프록시에서 TypeError가 발생합니다.
다음 코드는 new 연산자를 트랩합니다.
다음 코드는 불변 조건을 위반합니다.
다음 코드는 프록시를 부적절하게 초기화합니다. 프록시 초기화의 target 자체는 new 연산에 대한 유효한 생성자여야 합니다.
| ECMAScript® 2027 Language Specification # sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.