I have experienced some new errors I have not seen before in scripting and have come back here to share my quick solution.
First, the problem was occurring when using an Illustrator javascript type in an instanceof comparison. The exact issue was (item instanceof Swatch) to check if the input to a function was really a Swatch object or say, a string, etc.
While this did work before, now I got the surprising error that "Swatch" is undefined - and not only that but the entire script stops at that point.
Here is a result when a try-catch is used:
try {
alert(Swatch);
} catch (e) {
alert(e);
}

Now how could an Illustrator constructor be undefined? After all, it's right there in the PDF documentation still. I went back and checked and it's still there - so what gives? I then ran a piece of code
var doc = app.activeDocument;
try {
alert(doc.swatches[0].constructor.name);
alert(Swatch);
} catch (e) {
alert(e);
}


Aha! It works!
So the solution, in case you run into the same issue with other constructors, etc - just reference an instance of such an object anywhere in the script before using the instanceof operator.. and it seems to nudge the scripting API to act properly.
var doc = app.activeDocument;
alert("Is the first document swatch an instance of Swatch? : " + (doc.swatches[0] instanceof Swatch) + "\nIs this string 'Hello World' and instance of Swatch? : " + ("Hello World" instanceof Swatch));