According to http://www.mediawiki.org/wiki/ResourceLoader/JavaScript_Deprecations#wikibits.js importScript should be replaced by mediaWiki.loader.load in the future, but at the moment it's not a good substitute. If you want a script to be loaded both via http or https depending you have to replace
importScript('User:Foo/bar.js');
by
mediaWiki.loader.load(mediaWiki.config.get('wgServer') mediaWiki.config.get('wgScript') '?title=User:Foo/bar.js&action=raw&ctype=text/javascript');
Another user suggested the syntax
mediaWiki.loader.load('[[User:Foo/bar.js]]');
This has two advantages: It doesn't conflict with names of modules and it generates an entry in "What links here".
Version: 1.17.x
Severity: enhancement