[Laszlo-dev] For Review: Change 20071107-dda-g Summary: Allow type information for vars, even though ignored in SWF7/8 and DHTML.
Donald Anderson
dda at ddanderson.com
Wed Nov 7 15:51:29 PST 2007
Change 20071107-dda-g by dda at freddie.local on 2007-11-07 18:14:27 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Allow type information for vars, even though ignored in
SWF7/8 and DHTML.
New Features:
Allow type information accepted in ActionScript 3.0, that is:
var x:int;
var y:String = "hello";
var z:?String = null; // ? means can set to null (default)
var z:String! = "bonjour"; // ! means cannot set to null
Please note that the type information is merely accepted as part
of the language, and ignored for now.
Bugs Fixed: LPP-5059
Technical Reviewer: ptw
QA Reviewer: philip
Doc Reviewer: (pending)
Documentation:
Requires documentation if we describe in detail our language (or
subset). If we point
users to the published standards, then we can continue to do that.
We should note that type information is ignored except for the
(upcoming) SWF9 runtime.
Release Notes:
Variables declared using the 'var' statement now allow type
specifications as
described by Ecmascript 4 (that is, ActionScript 3.0).
Details:
No type checking is done by the SWF7/8 and DHTML runtimes (nor
is planned), any
type information is thrown away. However, when SWF9 is
available, the type information
will be accepted and passed through to the 3rd party SWF9
compiler, which will do type
checking for any variable with type information. This change
allows users and developers
to write code that can be useful with either runtime. Even if
they don't use with SWF9,
this is a useful feature for self documenting usage of variables.
We currently allow type information on 'var' declarations, also
method parameters and
method return values. I believe only information for 'var'
declarations can be done
in .lzx, but the latter two are also accepted (and ignored for
current runtimes) in .lzs files.
Tests:
Ran new test test/typevar.lzx for both SWF7/8 and DHTML, to make
sure syntax is accepted.
Ran smokecheck.lzx to assure there are no regressions.
Files:
A test/typevar.lzx
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
ASTIdentifier.java
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071107-dda-
g.tar
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
Voice: 617-547-7881
Email: dda at ddanderson.com
WWW: http://www.ddanderson.com
More information about the Laszlo-dev
mailing list