Using Rhino 1.7.6, this script works:
input = [ { foo: [ "aaa", "bbb", "ccc" ] } ];
var output = [];
input.forEach(function (obj) {
obj.foo.forEach(function(s) { output.push(s); });
});
but this one does not:
input = [ { foo: [ "aaa", "bbb", "ccc" ] } ];
var output = [];
input.forEach(function (obj) {
obj.foo.forEach(output.push);
});
instead, throwing this exception on line 4:
org.mozilla.javascript.EvaluatorException: Cannot modify a property of a sealed object: 0.
Why?
I feel like I'm missing something obvious here...