Skip to content
Permalink
Browse files

[FIXED JENKINS-15617]

execScript cannot return value [1], so I'm restricting its use to where
we don't care about the return value. See ticket for more discussions

[1] http://msdn.microsoft.com/en-us/library/ie/ms536420(v=vs.85).aspx
  • Loading branch information
kohsuke committed Oct 27, 2012
1 parent 49646bf commit 1c578ab5542bd20904c4a5e4ebcc80b42af31bbb
Showing with 4 additions and 3 deletions.
  1. +4 −3 war/src/main/webapp/scripts/hudson-behavior.js
@@ -369,7 +369,8 @@ function parseHtml(html) {
*/
function geval(script) {
// see http://perfectionkills.com/global-eval-what-are-the-options/
return (this.execScript || eval)(script);
// note that execScript cannot return value
(this.execScript || eval)(script);
}

/**
@@ -500,7 +501,7 @@ function isInsideRemovable(e) {
*/
function renderOnDemand(e,callback,noBehaviour) {
if (!e || !Element.hasClassName(e,"render-on-demand")) return;
var proxy = geval(e.getAttribute("proxy"));
var proxy = eval(e.getAttribute("proxy"));
proxy.render(function (t) {
var contextTagName = e.parentNode.tagName;
var c;
@@ -716,7 +717,7 @@ var jenkinsRules = {
(function() {
var cmdKeyDown = false;
var mode = e.getAttribute("script-mode") || "text/x-groovy";
var readOnly = geval(e.getAttribute("script-readOnly")) || false;
var readOnly = eval(e.getAttribute("script-readOnly")) || false;

var w = CodeMirror.fromTextArea(e,{
mode: mode,

0 comments on commit 1c578ab

Please sign in to comment.
You can’t perform that action at this time.