Gmail already restricts .exe, .msc and .bat files, no name a few.
As of February 13th, 2017 add another to the list, .js files.
If you try attaching any of these files, you will get this in-product warning appear and it will tell you why.
Now you can still use Drive, Cloud storage and other solutions to share or send these files. Just not Gmail.