Simplify code in AS json encoder
Merge pull request #8815 from bogdan/simplified-to-json-args

AS JSON encoder: remove monkey patch of Array