Eval
qmllint에서는 이 경고 범주를 ' [eval] '로 표기합니다.
eval을 사용하지 마십시오
무슨 일이 있었나요?
코드에서 eval 를 사용했습니다.
왜 문제가 됩니까?
eval 메서드는 속도가 느리고 잠재적으로 위험합니다. eval 는 인수를 마치 자체 JavaScript 스크립트인 것처럼 실행하기 때문에 실행에 약간의 오버헤드가 발생합니다. eval 에 전달된 인수는 원격 코드 실행 공격의 매개체가 될 가능성이 있습니다.
예시
import QtQuick
Item {
function f() {
let myString = "x",
myObject = {
x: 10
},
value = eval("myObject." + myString);
}
}이 경고를 해결하려면, 코드에 eval 호출이 포함되지 않도록 코드를 수정하십시오.
import QtQuick
Item {
function f() {
let myString = "x",
myObject = {
x: 10
},
value = myObject[myString];
}
}© 2026 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.