They can invoke the proprietary/copyright claims, but saying that JS is "closed source" just doesn't make sense when the source code is what gets distributed. IMHO it's the same situation with HTML and CSS.
Unless you have the right to do so because you are the copyright holder or have a licence you can't distribute code no matter whether you have access to the code or not.
There are fair-use exemptions, but when it comes to computer software, these exemptions suddenly become zero. Making a disclosure and proving a security/privacy flaw becomes extremely difficult.