// Ensure that a stringify replacer function gets a chance to do something sane with native java array

var nja = java.lang.String.valueOf("a,b,c").split(",");
var expected = JSON.stringify("a,b,c".split(/,/));
try {
  var actual = JSON.stringify(nja, function(key, value) {
    if (value instanceof java.lang.Object) {
      if (value instanceof Array)
        return value.slice();
      if (value instanceof java.lang.CharSequence)
        return String(value);
    }
    return value;
  });
} catch (e) {
  throw "JSON.stringify(nja, replacer) threw an Exception: " + JSON.stringify(e);
}
if (actual !== expected) {
  throw "Expected '" + expected + "', got '" + actual + "'";
}

"success";
