Addresses #1447 - Can't do JavaScript-specific stuff without causing a compile error in Java-mode.