A collection of ES5 shims for polyfiling Exendscript (for es6 shims take a look at https://github.com/ExtendScript/extendscript-es6-shim)
npm init -y npm install extendscript-es5-shim
Array, String and Function notes
All polyfills could be used in your code.
Because it is impossible to emulate property descriptors in ES3 engine, the following functions are just a mocks and you should avoid to use them in your code if it is possible, only shim thirdparty libraries:
Supports only data descriptor. Writable, enumerable and configurable properties of descriptor are ignored. If you try to define set or get propperty this methods will throw an error.
Supports only data descriptor. Configurable property of descriptor is always TRUE. Enumerable and writable properties of descriptor will be always TRUE on user defined objects, but may vary on build in.
freeze, preventExtensions, seal
Only validate input parameter and return input if it is an object.
isExtensible, isFrozen, isSealed
Validates input and returns TRUE, FALSE, FALSE, respectively if input parametr is an object.
These functions you can use in your code:
Support of property descriptor is in the same level as in defineProperty. Although, you can use this function in your code like this:
var obj1 = a : 1;var obj2 = Object;
or like that:
var obj1 = a : 1;var obj2 = Object;obj2b = 2;
Use for in loop along with hasOwnProperty function to get own enumerable properties in object.
Use build in
__proto__ property as return value.
- Install the devDependencies by running
- Bundle the index.js by running
npm run bundle
- Add new prototypes in the respective folders
- If you need new folders, add the folder to the top of
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!