- Notifications
You must be signed in to change notification settings - Fork14
ExtendScript/extendscript-es5-shim
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A collection of ES5 shims for polyfiling Exendscript (for es6 shims take a look athttps://github.com/ExtendScript/extendscript-es6-shim)
npm init -ynpm install extendscript-es5-shimAll 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 onlydata descriptor.Writable,enumerable andconfigurable properties of descriptor are ignored. If you try to defineset orget propperty this methods will throw an error.
Supports onlydata descriptor.Configurable property of descriptor is alwaysTRUE.Enumerable andwritable properties of descriptor will be alwaysTRUE on user defined objects, but may vary on build in.
Only validate input parameter and return input if it is an object.
Validates input and returnsTRUE, 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 indefineProperty. Although, you can use this function in your code like this:
varobj1={a :1};varobj2=Object.create(obj1,{b :{value :2}});
or like that:
varobj1={a :1};varobj2=Object.create(obj1);obj2.b=2;
This function uses reflection interface, that ExtendScript provides (see JavaScript Tools Guide), to get own properties of an object (enumerable or not). But ther is no guarantee that the order of enumeration will be the same as infor in loop.
Usefor in loop along withhasOwnProperty function to get own enumerable properties in object.
Use build in__proto__ property as return value.
- Install the devDependencies by running
npm install - 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
./bin/concat.jsinto thefoldersarray
Thanks goes to these wonderful people (emoji key):
Manuel 💻 | EugenTepin 💻 | Michael Deal 💻 | Andy Dayton 💻 | Todd Fast 💻 | silmelumenn 💻 | Fabian Morón Zirfas 💻 |
This project follows theall-contributors specification. Contributions of any kind welcome!
About
A collection of ES5 shims for polyfiling Exendscript
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.