johnmarsden
8 years agoVisitor
Hilarious Roku bug of the day: .delete(xyz)
I found that using
wasn't working 100% as expected. If I tried to access objects in there later, the list didn't shift.. or something. Not sure what exactly happens behind the scenes, but it wasn't working correctly.
I would delete index #1 at some point.. then add another.. then try to access listObject[1], which would always crash; consistently.
Then I tried debugging it by doing:
and it would print the object out as expected... but also, it didn't break anymore.
This is 100% consistent. I tested multiple times, multiple scenarios, with and without the print log. I did it with the debugger on and off.
When the print command was commented out... it crashed.
When the print command was uncommented... it worked.
Every. Single. Time.
listObject.delete(index)
wasn't working 100% as expected. If I tried to access objects in there later, the list didn't shift.. or something. Not sure what exactly happens behind the scenes, but it wasn't working correctly.
I would delete index #1 at some point.. then add another.. then try to access listObject[1], which would always crash; consistently.
Then I tried debugging it by doing:
listObject.delete(index)
print listObject
and it would print the object out as expected... but also, it didn't break anymore.
This is 100% consistent. I tested multiple times, multiple scenarios, with and without the print log. I did it with the debugger on and off.
When the print command was commented out... it crashed.
When the print command was uncommented... it worked.
Every. Single. Time.