I have come across this when using as3hx to port my AS3 code to Haxe:
delete classMemberDictionary[key]
as3hx can't translate this to Haxe, you have to do it manually. I've read the as3hx README and it says
- if it is a local variable, replace
delete varname
withvarname = null
- if it is a class member variable, remove the
delete
entirely
Since it is a dictionary item it doesn't seem right to just remove the line, as the README says. Should I set it to null
?
Are you using Map
or openfl.utils.Dictionary
? In either case you can use remove()
:
Setting the value to null
isn't quite the same. Although get()
would return null
in either case, exists()
still returns true
for entries that weren't explicitly removed.