-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Uncaught TypeError: Cannot read property 'isDestroyed' of undefined" #13
Comments
I don't really have any idea about the api of Atom, but I couldn't help but notices that the code in the clearAllMarkers function actually checks for truthiness of the marker: this.markers.forEach(function(marker) { if(marker && !marker.isDestroyed()) { marker.destroy(); } } ); But the popMarker function where this error occurs does not: ...
var m = _this.markers.shift();
_this.child.stdin.write("#pop\n");
if (!m.isDestroyed()) { // <-- error here
m.already_popped = true;
m.destroy();
}
... |
So I tried stepping through the code, and the reason m is undefined is because the array is empty and we never found the marker that we were looking for. Console output:
The value of the arguments:
And the markers:
Note that _this.markers[0].id === marker.id but
Same id, but different objects |
Replacing if (m === marker) With if (m.id === marker.id) seems to fix this. I have no idea if that is the proper way to do it though. |
Atom Version: 1.3.2
System: Microsoft Windows 10 Pro Insider Preview
Thrown From: fstar-interactive package, v0.1.0
Stack Trace
Uncaught TypeError: Cannot read property 'isDestroyed' of undefined
Commands
Config
Installed Packages
The text was updated successfully, but these errors were encountered: