less copypasta
attach JSDoc comments as nodes rather than strings

manual cherry-pick of 481418293304a87b0044afdd73a12c834bf0c77c from
mozilla/rhino