Which ECMAScript standards comply Adobe's ExtendScript implementation? (if any)

房东的猫 提交于 2019-12-04 12:06:27

问题


I'm a JavaScript developer, who has just begun to dive into Adobe's ExtendScript technology, aiming to improve productivity and workflow on many of my enterprise's daily tasks on Illustrator PDF form generation.

In first instance I thought it was an implementation of some ECMAScript standards with addition of a propertary implementation of a Document Object Model, an API for accessing the file system and some other stuff. I was hoping the last version of the Creative Suite (CS6) implemented ECMAScript 5.

My first surprise was not finding any reference on the internet about the implementation details of the ExtendScript engine. My second surprise was finding, when querying Array.prototype for some ECMAScript 5 methods, that it is undefined, which makes me doubt of the standards-compliance of the implementation.

Can anyone provide any reference on that implementation details, if it complies any ECMAScript standard and which version?

Lots of thanks in advance.


回答1:


If you look at the After Effects CS6 Scripting Guide, it says:

The After Effects scripting engine supports the 3rd Edition of the ECMA-262 Standard, including its notational and lexical conventions, types, objects, expres- sions, and statements. ExtendScript also implements the E4X ECMA-357 specification, which defines access to data in XML format.

I imagine the rest of the Adobe Collection is the same.




回答2:


You can add the ECMAScript 5 array methods to ExtendScript by including a modified version of this polyfill. The one modification you need to make is at the very end of array.generics.js, remove the block of code scoped by if (document). (around line 583).



来源:https://stackoverflow.com/questions/17222901/which-ecmascript-standards-comply-adobes-extendscript-implementation-if-any

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!