Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-16561]
eval("") is no-op in IE but window.execScript("") isn't.
So bring the uniformity outside
  • Loading branch information
kohsuke committed Feb 13, 2013
1 parent b5ed319 commit 3f48eff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Script evaluation script error on IE.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16561">issue 16561</a>)
<li class=bug>
surefire-reports not detected for android-maven-plugin
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16776">issue 16776</a>)
Expand Down
9 changes: 5 additions & 4 deletions war/src/main/webapp/scripts/hudson-behavior.js
Expand Up @@ -368,6 +368,8 @@ function parseHtml(html) {
* Evaluates the script in global context.
*/
function geval(script) {
// execScript chokes on "" but eval doesn't, so we need to reject it first.
if (script==null || script=="") return;
// see http://perfectionkills.com/global-eval-what-are-the-options/
// note that execScript cannot return value
(this.execScript || eval)(script);
Expand Down Expand Up @@ -2143,12 +2145,11 @@ function validateButton(checkUrl,paramList,button) {
Behaviour.applySubtree(target);
layoutUpdateCallback.call();
var s = rsp.getResponseHeader("script");
if(s!=null)
try {
try {
geval(s);
} catch(e) {
} catch(e) {
window.alert("failed to evaluate "+s+"\n"+e.message);
}
}
}
});
}
Expand Down

0 comments on commit 3f48eff

Please sign in to comment.