Port some PEG.js code updates since 2016
See: #441: Drop IE8 support and update code accordingly
- Replace arrays.each with native Array.prototype.forEach
- Replace arrays.every with native Array.prototype.every
- Replace arrays.some with native Array.prototype.some
- Remove arrays.pluck, arrays.map (unused)
- Replace objects.keys with native Object.prototype.keys
- Replace for loops with suitable array methods
-
Replace instanceof Array with Array.isArray() - Delete "opcodes.js" file (unused)
Need to determine what to do with ".pegjs" example files. Do we keep them (and maintain them)? Do we update the code to drop IE8 support as well? Or do we just drop them and defer to PEG.js's examples?
See https://github.com/pegjs/pegjs/commit/b81afb147129504f1d35ca11764a289548261f6c
- Don't quote "class"
Others
- Fix typos, convert var to const or let, use arrow functions