With

이 경고 카테고리의 철자는 [with] 입니다.

With 문

무슨 일이 있었나요?

JavaScript with 문이 사용되었습니다.

이것이 왜 나쁜가요?

With 문은 정규화되지 않은 식별자를 분석할 때 오탐을 일으킬 수 있습니다. 또한 with 문은 최신 JavaScript 표준에서 더 이상 사용되지 않는 것으로 표시되어 있습니다.

예시

import QtQuick

Item {
    function f() {
        with (Math) {
            return PI
        }
    }
}

이 경고를 수정하려면 with 문을 구조 파괴 속성으로 대체하세요:

import QtQuick

Item {
    function f() {
        const { PI } = Math;
        return PI
    }
}

참고: 여기에서 더 많은 대체 아이디어를 찾을 수 있습니다.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.