Only handle Array.prototype.toJSON if defined