This is a collection of polyfills for ExtendScript. Later editions of ECMAScript bring some useful new scripting features, and since they're syntactically compatible with older JavaScript engines they can mostly be polyfilled by patching methods onto built-in JS objects.
We prefer to use polyfills from MDN when available. (Discussed here)
A couple of bundles of modules often used together.
Modules that faithfully represent newer ECMAScript features.
- Array.every
- Array.from
- Array.isArray
- Array.filter
- Array.find
- Array.forEach
- Array.indexOf
- Array.lastIndexOf
- Array.map
- Array.reduce
- Array.reduceRight
- Array.some
- JSON
- Number.isFinite
- Number.isInteger
- Object.assign
- Object.create
- Object.keys
- String.trim
Modules that partially implements newer ECMAScript features.
- Function.bind
- Object.defineProperties
- Object.defineProperty
- Object.freeze
- Object.getOwnPropertyDescriptor
- Object.getOwnPropertyNames
- Object.getPrototypeOf
- Object.isExtensible
- Object.isFrozen
- Object.isSealed
- Object.preventExtensions
- Object.seal
- Object.setPrototypeOf
Modules that we get used to in other environments.
Extensions to existing objects
- JSON.clone
- JSON.comparable
- JSON.cycle
- JSON.equals
- JSON.file
- JSON.instantiate
- JSON.parseRecurse
- JSON.parseState
- JSON.validate
Read the docs