Lines Matching defs:variable
45 #include "varbinder/variable.h"
255 void ETSChecker::ValidateUnaryOperatorOperand(varbinder::Variable *variable)
257 if (variable == nullptr || IsVariableGetterSetter(variable) || variable->Declaration() == nullptr) {
261 if (variable->Declaration()->IsConstDecl() || variable->Declaration()->IsReadonlyDecl()) {
262 std::string_view fieldType = variable->Declaration()->IsConstDecl() ? "constant" : "readonly";
264 !variable->HasFlag(varbinder::VariableFlags::EXPLICIT_INIT_REQUIRED)) {
265 LogTypeError({"Cannot reassign ", fieldType, " ", variable->Name()},
266 variable->Declaration()->Node()->Start());
267 variable->SetTsType(GlobalTypeError());
271 LogTypeError({"Cannot assign to a ", fieldType, " variable ", variable->Name()},
272 variable->Declaration()->Node()->Start());
273 variable->SetTsType(GlobalTypeError());