JAS language

From JASPA

Jump to: navigation, search

Contents

[edit] Introduction

JAS is the language that the JASPA compiler converts to regular JavaScript; it is very similar to ActionScript 3.

The acronym JAS derives from JavaScript/ActionScript, but officially it means "JavaScript; Advanced Syntax". This is partly due to potential trademark problems, and partly to make the distinction that it is a separate language. The JASPA compiler contains absolutely no Adobe technology, or source code whatsoever.

The JAS syntax is designed to be as close to AS3 (ActionScript) as possible. Ideally it would be identical, but for various reasons it is just very similar. Ultimately JAS is an unofficial extension to the ECMAScript standard, adding the kind of OOP enhancements that ActionScript programmers will find very familiar.

[edit] Extended language features

[edit] Strong typing

  • The same fundamental type-declaration principals of AS2 & AS3 are in JAS.
  • The AS3 as operator is supported as well as AS2-style type-casting.

[edit] Untyped objects

  • The concept of an untyped object is supported, but AS3 wildcard syntax is not.
  • As per AS3, untyped objects are the only ones that may contain the special value undefined.

[edit] Packages & Classes

  • AS3-style package and class declarations are supported, as are the folder/file naming conventions.
  • Classes are imported with the import keyword.
  • Package-level members are not supported, but there is an internal namespace.
  • Unlike AS3, classes are not permitted outside a package declaration block. Private classes, (those available only within a class file), are defined inside the package block instead.

[edit] Code hiding & namespaces

  • public, private, protected, and internal namespaces are supported, but custom namespaces are not.
  • Unlike AS2, cheating these namespaces at compile-time may result in run-time errors.
  • The AS3 keywords final and override are also enforced.

[edit] Inheritance and Super

  • Class inheritance is supported
  • final and override keywords are supported and enforced.
  • super is supported.
  • Use of super() in class constructors is implemented as per AS3, which improves slightly on the AS2 implementation.

[edit] Getters & setters; property overloading

  • get and set function keywords are supported, and even enforced at runtime.

[edit] Method Closures

[edit] Constants

  • The const keyword is supported.
  • At runtime these are only variables, but the compiler will enforce a read-only trait.

[edit] Rest arguments operator

  • The ... rest args operator is supported in function arguments as per AS3.

[edit] Function parameter defaults

  • Default function parameters are supported; e.g.

function ( a:Number = 1 ){}

[edit] Implicit this

  • Lazy omission of this is permitted inside non-static class methods;
  • The current object scope is checked before the outer scope, and after the local scope.

[edit] Omitted language features

[edit] int & uint

  • After some experiments in implementing non-native integer classes, these have been omitted from JAS.
  • They may be introduced in future, but as they will always be non-native there is little advantage of including them.

[edit] Native XML type

  • There are no plans to support E4X.

[edit] Meta data

  • There are no plans and probably no reason to support ActionScript-style meta data in JAS.

[edit] Type wildcard

  • The following is invalid in JAS and will raise a syntax error:

var Obj:*;

  • To declare an object untyped, just don't declare any type at all.

[edit] To do

[edit] Interfaces & abstract members

  • These are not currently supported, but they will be introduced in the near future.

[edit] each

  • The each keyword is currently in the syntax, but not yet converted by the compiler into JavaScript-safe code.

TFX578 <a href="http://gkeevrbdzqnh.com/">gkeevrbdzqnh</a>, [url=http://cconoehklxoq.com/]cconoehklxoq[/url], [link=http://hnnktcikcfwt.com/]hnnktcikcfwt[/link], http://utugdlodqjiz.com/

Personal tools