pkg/eval: Remove reference to the now-gone local: scope.

This commit is contained in:
Qi Xiao 2022-02-20 23:30:15 +00:00
parent 8c9414a0ec
commit d7a9d38731
2 changed files with 1 additions and 3 deletions

View File

@ -150,7 +150,7 @@ func compileDel(cp *compiler, fn *parse.Form) effectOp {
f = delLocalVarOp{ref.index}
cp.thisScope().infos[ref.index].deleted = true
} else {
cp.errorpf(cn, "only variables in local: or E: can be deleted")
cp.errorpf(cn, "only variables in the local scope or E: can be deleted")
continue
}
} else {

View File

@ -189,8 +189,6 @@ func TestDel(t *testing.T) {
// Deleting variable
That("var x = 1; del x").DoesNothing(),
That("var x = 1; del x; echo $x").DoesNotCompile(),
That("var x = 1; del :x; echo $x").DoesNotCompile(),
That("var x = 1; del local:x; echo $x").DoesNotCompile(),
// Deleting environment variable
That("has-env TEST_ENV", "del E:TEST_ENV", "has-env TEST_ENV").Puts(true, false),
// Deleting variable whose name contains special characters