If ActionScript is based on ECMAScript, why does it have classes and look almost the same as Java?

This article says that ActionScript 3.0 corresponds to the 4th release of ECMA. But instead of looking like JavaScript and not having a class or extension, ActionScript 3.0 code looks like Java and has a class statement and even has extend ?

+7
source share
4 answers

ActionScript 3 was developed while the ECMA 4 specification was still under development. He diverges; It complies with ECMA 4, but goes beyond it.

+5
source

Because the ECMAScript 4th Edition project, based on ActionScript 3, had class and extends and so on.

http://en.wikipedia.org/wiki/ECMAScript#ECMAScript.2C_4th_Edition

http://www.ecma-international.org/activities/Languages/Language%20overview.pdf

The fourth edition project was later replaced by ECMAScript Harmony:

http://en.wikipedia.org/wiki/ECMAScript#History_2

Some will say that the reason for this was a business policy , but you would have to make your own informed opinion about it.

+3
source

ActionScript has been ECMA compatible from the start.

You could imagine javascript and actionscript as a plug from the same standard, that is, ECMA, with Javascript, which tends to add power to the browser, and ActionScript, to the development of flash memory.

It seems fair, since each company at one time tried to create its own version. For example, consider the Microsoft version of ECMA.

You can also consider from the link itself that you shared:

In response to a user's need for a language better suited for larger and more complex applications, ActionScript 2.0 showed compile-time type checking and class-based syntax such as a class of keywords and continues.

So, you could see that most of the changes were really user-driven, not the attendant similarities.

+2
source

In general, being standard does not mean that only functions defined by the standard should be available. You can implement a standard that must be compatible, but you can also implement additional functions.

You can consider ECMA Script as a kind of subset that defines the basic structure of the language, syntax and semantics. Then ECMA is just a subset of ActionScript. Language adds to this subset a wide range of functions.

Another example might be MySQL. It implements the SQL standard, but provides much more functionality, as the standard would do.

0
source

All Articles