Skip to content

Commit

Permalink
[FIXED JENKINS-15617]
Browse files Browse the repository at this point in the history
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 1c578ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions war/src/main/webapp/scripts/hudson-behavior.js
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1c578ab

Please sign in to comment.