/src/main/java/org/htmlunit/html/ScriptElementSupport.java
try { final Document doc = win.getDocument( ) ;
final Document doc = win.getDocument ( ) ; try {
Charset charset = EncodingSniffer.toCharset(scriptElement.getCharsetAttribute()); if (charset == null) { charset = page.getCharset(); } final JavaScriptLoadResult result; final Window win = page.getEnclosingWindow().getScriptableObject(); <extra_id_0> doc.setCurrentScript(element.getScriptableObject()); result = page.loadExternalJavaScriptFile(src, charset); } finally { doc.setCurrentScript(null); }