Code Transformation and Linting with ASTs Challenge 4: Edge Cases
Transcript from the "Challenge 4: Edge Cases" Lesson
>> Speaker 1: So this next one is quite a bit bigger. Let's go ahead and run the exercise script. So we'll run, it's number two is our exercise, so exercises.esn.two.
>> Speaker 2: That wasn't the one we just were on?
>> Speaker 1: Maybe it was. Yes, so it was, you're right. How did?
[00:00:23] Wait a second.
>> Speaker 1: You're right, that was the one we were just on. Three,
>> Speaker 1: Sorry.
>> Speaker 1: Let me copy that one over to the chat.
>> Speaker 1: Okay, so now your code should look like mine.
>> Speaker 1: And we have a new case here. So somebody, some person, decided that it would be a good idea to reassign console to CSL, I don't know, and then start calling stuff on that.
[00:01:01] Maybe they didn't like that our es lint rule was yelling at them or something. So this is where things really start to get edge casey. And you can think of some really edge case things, like what if they assign this to x? And then, wait, we're gonna bind, or take the log and bind it to CSL or console or something like that, now we're calling x.
[00:01:24] So there's a point where you just say, okay, I'm not gonna cover that edge case, because anybody writing code like that doesn't deserve to have my plugin.
>> Speaker 2: [LAUGH]
>> Speaker 1: But there are like, if it really is important to you, the cool thing is that you can do it, it's possible.
[00:01:40] You can handle these edge cases. And this is one that we definitely can, and the workshop does.