Skip to content

Commit

Permalink
[JENKINS-11618] backporting the fix here.
Browse files Browse the repository at this point in the history
I actually applied the diff from
6904bb61e31595b70260840937114e79a646da5d in keyboard-shortcuts-plugin
  • Loading branch information
kohsuke committed Mar 2, 2012
1 parent 8009dcc commit 794cc76
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion war/src/main/webapp/scripts/prototype.js
Expand Up @@ -346,7 +346,30 @@ var Class = (function() {
extend(Object, {
extend: extend,
inspect: inspect,
toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,

// JENKINS-11618
//toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
toJSON: function(object) {
var type = typeof object;
switch(type) {
case 'undefined':
case 'function':
case 'unknown': return;
case 'boolean': return object.toString();
}
if (object === null) return 'null';
// "|| object.toJSON" below is workaround for Opera 10.52/53 bug, see HUDSON-6424
if (object.toJSON || object.toJSON) return object.toJSON();
if (object.ownerDocument === document) return;
var results = [];
for (var property in object) {
var value = Object.toJSON(object[property]);
if (value !== undefined)
results.push(property.toJSON() + ': ' + value);
}
return '{' + results.join(', ') + '}';
},

toQueryString: toQueryString,
toHTML: toHTML,
keys: Object.keys || keys,
Expand Down

0 comments on commit 794cc76

Please sign in to comment.