EngineHub / EngineHub/CommandHelper

Incorrect [Using undefined variable] error on unassigned variable declarations in autoconcat (non-strict mode)

未关闭
#1,179 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Java
星标
128
派生
70
PR 合并指标
30 天内没有已合并 PR

描述

When having variable declarations in a script where that variable might never be assigned to, then an incorrect `Using undefined variable: @var` runtime error is given if that declaration is inside an autoconcat.
Example code:
```
string @var;
msg();
```

Problem:
__autoconcat__() gets the value of declaration `string @var`, causing this runtime error.

贡献指南

打开贡献指南

调研方向

从 __autoconcat__() 开始,报告指出它会在非严格模式下读取未赋值声明的值。使用 `string @var;` 后跟 `msg()` 重现该示例,并验证当该声明从未被赋值时,autoconcat 不再引发 `Using undefined variable: @var`。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。