mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Don't generate op_inc whenever its used as an expression.
This commit is contained in:
parent
9b2f4976c9
commit
55c0a748b4
2 changed files with 15 additions and 1 deletions
|
|
@ -968,6 +968,20 @@ TEST(Script, MiscRegressions)
|
|||
)");
|
||||
|
||||
ASSERT_EQ(regression4.getFloat(), 0.5);
|
||||
|
||||
Con::setBoolVariable("$Debug::DumpByteCode", true);
|
||||
|
||||
ConsoleValue regression5 = RunScript(R"(
|
||||
function noOpInc()
|
||||
{
|
||||
%count = 0;
|
||||
%var[%count++] = 2;
|
||||
return %var[1];
|
||||
}
|
||||
return noOpInc();
|
||||
)");
|
||||
|
||||
ASSERT_EQ(regression5.getInt(), 2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue