[Laszlo-checkins] r7498 - in openlaszlo/branches/devildog: . WEB-INF/lps/config WEB-INF/lps/lfc/compiler WEB-INF/lps/lfc/core WEB-INF/lps/lfc/data WEB-INF/lps/lfc/debugger WEB-INF/lps/lfc/debugger/platform/dhtml WEB-INF/lps/lfc/debugger/platform/swf WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/kernel/swf WEB-INF/lps/schema WEB-INF/lps/server WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api WEB-INF/lps/server/sc/src/org/openlaszlo/sc WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser WEB-INF/lps/server/src/org/openlaszlo/compiler WEB-INF/lps/server/src/org/openlaszlo/js2doc WEB-INF/lps/server/src/org/openlaszlo/sc docs/includes docs/src/deployers docs/src/developers docs/src/developers/programs docs/src/developers/tutorials/programs docs/src/xsl docs/src/xsl/js2doc2dbk lps/includes/source test
dda@openlaszlo.org
dda at openlaszlo.org
Mon Dec 10 14:48:27 PST 2007
Author: dda
Date: 2007-12-10 14:47:57 -0800 (Mon, 10 Dec 2007)
New Revision: 7498
Added:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMemory.lzs
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTFormalParameterList.java
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java
Modified:
openlaszlo/branches/devildog/
openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties
openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataElement.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDatapointer.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMessage.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMonitor.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzTrace.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzMemory.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/schema/lfc.lzx
openlaszlo/branches/devildog/WEB-INF/lps/server/build.xml
openlaszlo/branches/devildog/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2Doc.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
openlaszlo/branches/devildog/docs/includes/styles.css
openlaszlo/branches/devildog/docs/src/deployers/deploy-preface.dbk
openlaszlo/branches/devildog/docs/src/deployers/deployers-guide.dbk
openlaszlo/branches/devildog/docs/src/developers/animation.dbk
openlaszlo/branches/devildog/docs/src/developers/css.dbk
openlaszlo/branches/devildog/docs/src/developers/programs/color-$7.lzx
openlaszlo/branches/devildog/docs/src/developers/tutorials/programs/text-tutorial-$14.lzx
openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/synopsis.xsl
openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl
openlaszlo/branches/devildog/docs/src/xsl/parameters.xsl
openlaszlo/branches/devildog/lps/includes/source/embednew.js
openlaszlo/branches/devildog/test/typevar.lzx
Log:
Merged revisions 7424-7497 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
.......
r7426 | max | 2007-11-30 20:22:28 -0500 (Fri, 30 Nov 2007) | 24 lines
Change 20071130-maxcarlson-w by maxcarlson at Roboto on 2007-11-30 13:18:21 PST
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix replication of text with local datasets
New Features:
Bugs Fixed: LPP-5173 - Change r7406 broke replication of text with local datasets
Technical Reviewer: bargull
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Apparently, sprites _do_ need recursive destruction in some cases.
Tests: See LPP-5173.
.......
r7431 | ben | 2007-12-03 13:36:32 -0500 (Mon, 03 Dec 2007) | 19 lines
Change 20071203-ben-v by ben at slim.local on 2007-12-03 10:33:34 PST
in /Users/ben/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Take out breaking test, js2doc.JS2Doc_Test LPP-5184
Bugs Fixed: let the build run to completion
Documentation:
This broken test was breaking the build. I've temporarily disabled
the test, and filed the breakage as LPP-5184. The breakage
has something to do with comments separating declarations, like so:
var foo, bar;
Tests:
cd WEB-INF/lps/server
ant test ... should pass.
.......
r7437 | max | 2007-12-03 18:04:35 -0500 (Mon, 03 Dec 2007) | 31 lines
Change 20071203-maxcarlson-l by maxcarlson at Roboto on 2007-12-03 11:30:32 PST
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix null dereferences for LzDataElement.makeNodeList() nodes
New Features:
Bugs Fixed: LPP-5185 - Several null dereferences for replication of LzDataElement.makeNodeList() nodes in dhtml
Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: I ran across several null dereferencing errors when replicating LzDataElement.makeNodeList() nodes in DHTML.
LzLazyReplicationManager.lzs - Fix null dereferencing.
LzDatapointer.lzs - LzDataElement.makeNodeList() nodes don't have childNodes.
LzDataElement.lzs - Fix null dereferencing.
LzResizeReplicationManager.lzs - Fix null dereferencing.
Tests: See svn.laszloinaction.com/trunk/chap17 (you'll need the rails app installed) for the testcase.
.......
r7440 | bargull | 2007-12-04 05:21:58 -0500 (Tue, 04 Dec 2007) | 28 lines
Change 20071115-bargull-4 by bargull at dell--p4--2-53 on 2007-11-15 23:20:38
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: clickable- and visible-property in IE
New Features:
Bugs Fixed:
LPP-4916 - modaldialog cannot be dragged w/ IE7 DHTML in trunk build 6836
(and LPP-3539, LPP-4268, LPP-4919, LPP-5174, LPP-5179)
Technical Reviewer: max
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Depending on in which order you set "visible" and "clickable" attributes in dhtml/IE, you got phantom clickable views resp. non-clickable views at all. This was mainly caused by an unnecessary "else" in "LzSprite.prototype.setVisible(..)".
Tests:
see testcases at bugreports
.......
r7442 | hqm | 2007-12-04 09:07:51 -0500 (Tue, 04 Dec 2007) | 39 lines
Change 20071204-hqm-a by hqm at DADDY_THNKPAD67 on 2007-12-04 01:19:56 EST
in /cygdrive/c/users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: change runtime default to swf8, also change default cache sizes
New Features:
Bugs Fixed: LPP-5188
Technical Reviewer: ptw
QA Reviewer: max
Doc Reviewer:
Documentation:
Release Notes:
Details:
Change default runtime to swf8. Needed to modify embednew.js because it
had swf7 hardcoded in as the default runtime.
Also, changed LPS server cache sizes to match the demo server deployed values
which seem to make the server be stable these days.
Tests:
run this app and verify that it thinks the runtime is swf8
<canvas width="100%" height="80%" >
<simplelayout/>
<text text="${'canvas.runtime='+canvas.runtime}"/>
<text text="${'$swf7='+ $swf7+ ', $swf8=' + $swf8}"/>
</canvas>
.......
r7444 | max | 2007-12-04 15:05:52 -0500 (Tue, 04 Dec 2007) | 29 lines
Change 20071204-maxcarlson-X by maxcarlson at Roboto on 2007-12-04 00:26:37 PST
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix splash and sendToBack() on subviews of canvas
New Features:
Bugs Fixed: LPP-4212
Technical Reviewer: promanik
QA Reviewer: enw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Preserve old behavior from before r6973 for the canvas.
Tests: See LPP-4212
Files:
M WEB-INF/lps/lfc/kernel/swf/LzSprite.as
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071204-maxcarlson-X.tar
.......
r7445 | ptw | 2007-12-04 17:00:52 -0500 (Tue, 04 Dec 2007) | 28 lines
Change 20071202-ptw-w by ptw at dueling-banjos.local on 2007-12-02 20:37:06 EST
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Debugger improvements to help me with diamond DHTML
Bugs Fixed:
LPP-5182 'We could give better backtraces for unhandled errors in DHTML'
LPP-5181 'new calls do not have correct line number in backtrace'
Technical Reviewer: dda at ddanderson.com (Message-Id: <FA6270BB-CDAD-4533-B76B-25F0D9981C6C at ddanderson.com>)
QA Reviewer: ewinard at laszlosystems.com (pending)
Details:
LzMessage: Look for saved backtrace
LzRuntime: Pass uncaught error backtrace to LzMessage
JavascriptGenerator, CodeGenerator: Break out call-site
annotation, use in function calls and new calls
JavascriptGenerator: Put a catch block around all functions to
record a backtrace if an exception is thrown and not caught.
Tests:
smokecheck, test case from bugs
.......
r7448 | ptw | 2007-12-04 23:23:05 -0500 (Tue, 04 Dec 2007) | 38 lines
Change 20071204-ptw-z by ptw at dueling-banjos.local on 2007-12-04 17:04:11 EST
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Implement scriptlimits for SWF runtime
New Features: The canvas tag has a new attribute, swflimits which is
of type css, which can be used to override the default recursion (256)
and timeout (15s) limits. To do so you say:
<canvas scriptlimits="timeout: 30">
or to override both limits
<canvas scriptlimits="recursion: 300; timeout: 30">
Bugs Fixed:
Technical Reviewer: henry.minsky at gmail.com (message://<8c61fad60712041542w5c964533v4f36a1d693b63f72@mail.gmail.com>)
QA Reviewer: antun at laszlosystems.com (pending)
Doc Reviewer: lou at louiorio.com (pending)
Documentation:
See "New Features". For complete example demonstration, see the test
case attached to the bug.
Details:
schema/lfc: add scriptlimits attribute to canvas
CanvasCompiler: parse scriptlimits and store in environment
SWFWriter: Don't try to write scriptlimits immediately. When
closing the file, if the limits have been set (are non-zero) add
them.
ScriptLimits: Correct defaults. If called with a 0 value, use the default.
Tests:
smokecheck, test case from Jira
.......
r7449 | ptw | 2007-12-05 07:33:26 -0500 (Wed, 05 Dec 2007) | 13 lines
Change 20071205-ptw-s by ptw at dueling-banjos.local on 2007-12-05 07:30:31 EST
in /Users/ptw/OpenLaszlo/ringding-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Tracing cleanup
Details:
Make tracing play correctly with class system
Tests:
Inspection
.......
r7451 | lou | 2007-12-05 08:16:20 -0500 (Wed, 05 Dec 2007) | 18 lines
Change 20071205-lou-F by lou at loumac.local on 2007-12-05 09:09:38 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: restore header titles, header and footer navigation links
Bugs Fixed: LPP-5194
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Details: enable header titles, header and footer navigation links in docs/src/xsl/parameters.xsl
Tests: manually verify
.......
r7453 | lou | 2007-12-05 09:00:35 -0500 (Wed, 05 Dec 2007) | 16 lines
Change 20071205-lou-K by lou at loumac.local on 2007-12-05 09:53:35 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: suppress generation of lists of tables, figures, and examples
Bugs Fixed: LPP-5195
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: verify manually
.......
r7462 | lou | 2007-12-06 06:57:20 -0500 (Thu, 06 Dec 2007) | 15 lines
Change 20071206-lou-H by lou at loumac.local on 2007-12-06 07:48:04 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: turn off shading in table of contents
Bugs Fixed: LPP-5206
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: verify visually
.......
r7470 | lou | 2007-12-06 12:58:46 -0500 (Thu, 06 Dec 2007) | 16 lines
Change 20071206-lou-k by lou at loumac.local on 2007-12-06 13:54:02 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Intro to text, Example 9.13. Move the "Add Text" button so it's not obscured by the debug window.
Bugs Fixed: LPP-5209
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: verify visually
.......
r7471 | ptw | 2007-12-06 13:55:56 -0500 (Thu, 06 Dec 2007) | 21 lines
Change 20071206-ptw-h by ptw at dueling-banjos.local on 2007-12-06 07:52:27 EST
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Correct CSS color heuristic
Bugs Fixed:
LPP-5167 'DHTML setResource error tickled by lzmail'
Technical Reviewer: ben at openlaszlo.org (pending)
QA Reviewer: ewinard at laszlosystems.com (pending)
Details:
Heuristic for detecting use of '0xNNNNNN' as a color in CSS was
incorrectly converting an empty string to `0` (leading to havoc).
Be much more careful with this heuristic.
Tests:
smokecheck, lzmail now gets past this error
.......
r7473 | lou | 2007-12-06 14:27:29 -0500 (Thu, 06 Dec 2007) | 15 lines
Change 20071206-lou-j by lou at loumac.local on 2007-12-06 15:23:28 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Chapter 20 Color section 3.4: fix example so text in debug window is not truncated
Bugs Fixed: LPP-5211
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: verify visualy
.......
r7475 | lou | 2007-12-06 15:11:13 -0500 (Thu, 06 Dec 2007) | 15 lines
Change 20071206-lou-q by lou at loumac.local on 2007-12-06 16:06:53 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Change CSS chapter title and toc to match rev 3.4
Bugs Fixed: LPP-5212
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: verify visually
.......
r7476 | dda | 2007-12-06 15:37:08 -0500 (Thu, 06 Dec 2007) | 120 lines
Change 20071205-dda-z by dda at freddie.local on 2007-12-05 10:32:16 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Initial support for keywords in script compiler
New Features: no exposed features yet
Bugs Fixed: LPP-5175
Technical Reviewer: ptw
QA Reviewer: hminsky
Doc Reviewer: (pending)
Documentation:
Nothing here affects .lzx files, and even for lzs coders, there is no effect
unless the new keywords are used. Even so -- they don't do anything for SWF8/9,DHTML,
they are merely accepted.. Some of these keywords will be used internally
to help implement SWF9 (in later reviews), some may be exposed to users indirectly
via .lzx tags in the future, at which time they may be documented.
All keywords used in accordance with ActionScript 3.0 and the Ecmascript draft standard.
Release Notes:
None.
Details:
Initial support for several JS2 keywords: 'dynamic', 'override', 'final',
'private', 'protected', 'public', 'internal'. The keyword 'static', although previously
supported, is now handled in same way as the new group. In fact new keyword modifiers (I just
noticed const) should now be easy to add. These keywords are all modifiers,
in that they appear as part of a function, class, var definition, before
the keywords 'function', 'class', 'var'. Multiple keywords can
of course appear, for example, 'public static var x;'
Also name space names can appear in this position, for example,
mynamespace function f1() { }
final override mynamespace function f2() { }
There is no specific ordering of keywords enforced, and there are few
restrictions: override is only for methods, dynamic is only for classes,
only a single namespace name can appear, and a namespace cannot appear
along with a visibility modifier ('public', 'private', 'protected', 'internal').
By 'initial support', I mean that the keywords are now accepted, in the proper
place and the infrastructure is available to take advantage of them.
For SWF9, we plan to implement most or all of these keywords.
Any code in the compilers or doc tools that already knew about 'static',
has been changed to use this new modifier class.
To make for easy handling of these modifiers (and potentially new ones), there
is a new AST type: ASTModifiedDefinition. This can generally appear in the AST
wherever a ClassDefinition, FunctionDeclaration or VariableStatement appears,
and it has a child which is the ClassDefinition, FunctionDeclaration, VariableStatement.
There is only one of these objects in the tree for any definition/declaration,
and it holds information about all modifiers, including namespace names for the
given declaration. This should make it easy to change any specifics about
the modifiers, which ones are supported, etc. and allows each runtime to make
its own decisions about how to treat the modifiers.
Tests:
smoketest for SWF7/8 and DHTML
exact comparison of LFC binaries (using 'generatePredictableTemps' option)
comparison of JS2doc outputs for representative classes
to ensure that no visible changes.
A basic .lzs test to test that various keyword combinations are accepted/rejected.
since 'test/' directory does not have .lzs files, I only include it here:
///////////////////////
// tests for new script compiler keywords
// to test keyword combinations that should
// give errors, uncomment lines beginning with //XXXX
function f1() { }
static function f2() { }
private static function f3() { }
static protected function f4() { }
static override function f5() { }
ns1 function f6() { }
ns1 final function f7() { }
final ns1 function f8() { }
var v1;
// Not allowed outside of class:
//XXXX public var badv1;
//XXXX static var badv2;
//XXXX protected static var badv3;
class c1 {
function cf1() { }
static function cf2() { }
private static function cf3() { }
static protected function cf4() { }
static override function cf5() { }
ns1 function cf6() { }
ns1 final function cf7() { }
final ns1 function cf8() { }
var cv1;
public var cv2;
static var cv3;
protected static var cv4;
}
private class c2 {}
ns2 class c3 {}
dynamic class c4 {}
// Multiple namespace names not allowed
//XXXX ns1 ns2 class badc1{}
// namespace not allowed with public/private/etc.
//XXXX public ns1 class badc2{}
//XXXX ns2 protected class badc3{}
// Inappropriate combinations
//XXXX override var badv4;
//XXXX dynamic function badf1() {}
//XXXX dynamic var badv5;
//XXXX override class badc4{}
///////////////////////
.......
r7477 | dda | 2007-12-06 16:48:23 -0500 (Thu, 06 Dec 2007) | 6 lines
Fixed problems caused by changed filename in:
Change 20071205-dda-z by dda at freddie.local on 2007-12-05 10:32:16 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
related to LPP-5175
.......
r7483 | dda | 2007-12-07 15:04:42 -0500 (Fri, 07 Dec 2007) | 60 lines
Change 20071206-dda-9 by dda at freddie.local on 2007-12-06 17:36:12 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-b
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fixes for [not] nullable syntax, and return type syntax for function.
New Features: none
Bugs Fixed: LPP-5059
Technical Reviewer: ptw
QA Reviewer: hminsky
Doc Reviewer: (pending)
Documentation: none
Release Notes: none - feature is not yet released or used.
Details:
The grammar fix for nullable is straightforward.
For function return values, given that functions
can be declared with/or without an identifier (using function expressions),
we cannot put the type information on an ASTIdentifier, since
there may not be one. The logical place to put the return value
is on the FormalParameterList, which might now be thought of as
the function's signature (if it weren't rather disruptive,
I would have changed the name). Any function whether created
as a declaration or expression, has a FormalParamterList, so it
is a convenient place in the grammar. Making this change
actually cleaned up the grammar slightly, I think.
Tests:
1) Run test/typevar.lzx to check nullable syntax, should give no errors.
2) Run lzsc on:
// tests for return types
function f1() { }
function f2() : void { }
function f3():Integer? { }
function f4():Integer! { }
function f5(x):Integer! { }
function f6(x:int):Integer! { }
function f7(x:int,y):Integer! { }
function f8(x,y:int):Integer! { }
function f9(x:int,y:int):Integer! { }
function f10(x:int?,y:int):Integer! { }
function f11(x:int?,y:int!):Integer! { }
var x = function (x:int?,y:int!):Integer! { }
Running lzsc is currently the only way to test this, that will probably change soon.
3) Compared binary LFC files from compiler to make sure no regressions.
4) Ran smokecheck.lzx to make sure no regressions.
.......
r7487 | dda | 2007-12-08 10:58:41 -0500 (Sat, 08 Dec 2007) | 31 lines
Change 20071208-dda-S by dda at freddie.local on 2007-12-08 09:57:44 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-b
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Allow type info for functions: Added missing file to last commit
New Features: none
Bugs Fixed: LPP-5059
Technical Reviewer: ptw
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation: none
Release Notes: none
Details:
Left out a new file from the previous review/commit.
This was a generated file from javacc, that now is not generated (we override it) as we needed a new method
to hold the return type. Sadly, I did not wait for the QA review last time, which would have caught it.
Missing this file breaks the build.
See history of LPP-5059 for more details.
Tests:
smoke/smokecheck.lzx
comparing compiler output files (pending)
.......
r7488 | ptw | 2007-12-08 19:53:16 -0500 (Sat, 08 Dec 2007) | 8 lines
Change 20071208-ptw-B by ptw at dueling-banjos.local on 2007-12-08 19:52:04 EST
in /Users/ptw/OpenLaszlo/ringding-2/WEB-INF/lps/lfc/debugger
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc/debugger
Summary: Copy LzMemory.as to LzMemory.lzs in preparation for making it
platform agnostic
.......
r7489 | ptw | 2007-12-09 08:42:32 -0500 (Sun, 09 Dec 2007) | 53 lines
Change 20071207-ptw-v by ptw at dueling-banjos.local on 2007-12-07 22:50:21 EST
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Bring memory tracing to the modern era
Bugs Fixed:
LPP-5205: 'Debug.whyAlive no longer shows reference keeping object alive'
Technical Reviewer: philip at pbrdev.com (message:<20071208152841.7BC797C16E at hemicuda.laszlosystems.com>)
QA Reviewer: yfang at laszlosystems.com (pending)
Details:
LzMessage: fix error in concat observed in passing, make
appendInternal of another LzMessage concat, not present the
message
LzMemory: Make some things classes. Store leaks as a new class
that has a pretty descriptor and breaks out the leak information
for easy inspection. Use a stable sort on leaks, sort the biggest
leak to the front of the Array. Make whyAlive describe the top
leaks.
LzDebug.*: Use user toString methods, obey unique flag.
LzFormatter: New formatting flag `=` takes the next argument as
the object to be represented by the format (overriding the normal
hot-linking that occurs in the debugger so you can write a custom
representation for an object).
Tests:
Debug.markObjects()
Debug.findNewObjects()
Debug.whyAlive()
now yields useful information:
lzx> Debug.whyAlive()
global.spriteroot.$m1.debugloader.loadmc1.reqobj: (?\194?\16352) ?\194?\171Object#100| {_dbg_check:...?\194?\187
global.LzFocus.csel.sprite.__LZtextclip.filters: (?\194?\1636) ?\194?\171Array(0)#102| []?\194?\187
global.LzModeManager.__LZlastclick.sprite.__LZbuttonRef.but.filters: (?\194?\1636) ?\194?\171Array(0)#104| []?\194?\187
global.__offscreenkeyclip.filters: (?\194?\1636) ?\194?\171Array(0)#106| []?\194?\187
global.spriteroot.$m0.$m0.$m5.$LzText.filters: (?\194?\1636) ?\194?\171Array(0)#108| []?\194?\187
global.spriteroot.$m0.$m0.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#110| []?\194?\187
global.spriteroot.$m1.$m0.$m0.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#112| []?\194?\187
global.spriteroot.$m1.$m0.$m1.$m0.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#114| []?\194?\187
global.spriteroot.$m1.$m0.$m1.$m1.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#116| []?\194?\187
global.spriteroot.$m1.$m0.$m1.$m2.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#118| []?\194?\187
...
?\194?\171__LzLeaks(28)#120| 208 smoots?\194?\187
lzx>
.......
r7492 | ben | 2007-12-09 23:30:44 -0500 (Sun, 09 Dec 2007) | 42 lines
Change 20071209-ben-o by ben at slim.local on 2007-12-09 20:14:20 PST
in /Users/ben/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Don't issue so many unnecessary warnings in the doc build
Technical Reviewer: none
Documentation:
The js2doc build was issuing the same error over and over:
WARNING: Unexpected number of child nodes in ...
I changed this to be a "fine" log message, rather than a warning.
Now if we want to see it, we just set the log level to Level.FINE,
but we don't have to see it otherwise.
Similarly, there were lots of messages during the js2doc2dbk step of the
build regarding unknown types:
Warning! No jstype found for xxxx
and
Warning! No class name found for function synopsis: xxx.xxx.xxx
These are now toggled off with several parameters, set in these files:
in utilities.xsl:
<xsl:param name="warn.unspecified.lzxtypes" select="0" />
<xsl:param name="warn.unspecified.jstypes" select="0" />
In synopsis.xsl
<xsl:param name="warn.classname.not.found" select="0" />
These circumstances are visible in the reference itself as empty
entries in the Type (tag) and Type (js) columns of the attributes
list. The "no class name found" error is visible in the methods
list in the reference guide. Beneath the name of the method,
it's supposed to say className.methodName( params... ) but for the
cases that used to trigger warnings, it does not prepend a
class name.
Tests:
ant build doc
notice that there are hundreds fewer errors than before.
.......
r7493 | ben | 2007-12-09 23:35:49 -0500 (Sun, 09 Dec 2007) | 21 lines
Change 20071209-ben-K by ben at slim.local on 2007-12-09 18:14:33 PST
in /Users/ben/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix broken links in deployers guide and developers guide
Bugs Fixed: (partial) LPP-5148 Fix broken links in docs
Technical Reviewer: lou (pending)
Documentation:
Fixed broken links:
(x) http://localhost:8080/trunk/docs/guide/input-devices.html referenced in http://localhost:8080/trunk/docs/deployers/deployers-guide.html
(x) http://localhost:8080/trunk/docs/deployers/lps.properties referenced in http://localhost:8080/trunk/docs/deployers/deployers-guide.html
(x) http://localhost:8080/trunk/docs/developers/animation_library.lzx?lzt=source referenced in http://localhost:8080/trunk/docs/developers/animation.html
Tests:
Verified that the modified links at the urls above work.
.......
r7495 | dda | 2007-12-10 13:16:29 -0500 (Mon, 10 Dec 2007) | 2 lines
Merged ParseTreePrinter from devildog (this is a class split out from Compiler.java)
.......
r7496 | dda | 2007-12-10 13:50:53 -0500 (Mon, 10 Dec 2007) | 40 lines
Change 20071206-dda-3 by dda at freddie.local on 2007-12-06 19:04:34 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Separate ParseTreePrinter into its own class
New Features: none, only code reorg to make life easier for development.
Bugs Fixed: LPP-4786
Technical Reviewer: ptw
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation: none
Release Notes: none
Details:
ParseTreePrinter was an inner class within the Compiler class. In SWF9, we
separated this class to its own file to make it more natural to subclass.
However, ongoing maintenance and additions to Compiler.ParseTreePrinter
are troublesome to merge when they appear in devildog (each change
must be hand merged).
The diff associated with this review is messier than it could be -
since it shows all the changes made to this file after it was copied
into the tree from devildog. I essentially removed anything
SWF9 related - the new ParseTreePrinter.java is pretty much
an exact copy of Compiler.ParseTreePrinter with only minor
formatting changes and a couple changes needed to make
it compile. It might be better to compare (old) Compiler.ParseTreePrinter
with (new) ParseTreePrinter.java using 'diff -b'.
Tests:
Ran smokecheck
Compared the binaries for the LFCs before and after this change.
.......
Property changes on: openlaszlo/branches/devildog
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497 /openlaszlo/trunk:1-7423
+ /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497 /openlaszlo/trunk:1-7497
Modified: openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties 2007-12-10 22:47:57 UTC (rev 7498)
@@ -96,9 +96,13 @@
# Runtime Data cache
#dcache.directory=WEB-INF/lps/work/dcache
+cache.disk.size=20000000
+cache.mem.item.max=1000000
+cache.mem.size=1000000
+
# Cache sizes (0 = disabled (or allow 1 item for disk caches), -1 means infinite)
# Defaults are 500000000 for disk and 1000000 for mem
-#mcache.disk.size=500000000
+mcache.disk.size=20000000
#mcache.mem.size=1000000
# Max size allowable for an item to be cached in memory
@@ -114,6 +118,7 @@
# Compiler Media Cache
# there is no need to keep any of these files in memory
cmcache.mem.size=0
+cmcache.disk.size=20000000
# Keeps script cache small
scache.disk.size=10000000
@@ -148,7 +153,7 @@
# Where the LFC lives (relative to HOME)
compiler.runtime.dir=lps/includes/lfc
# Default runtime
-compiler.runtime.default=swf7
+compiler.runtime.default=swf8
# Turn backtraces on in the debugger (slower, off by default)
# compiler.debug.backtrace=true
# TODO: Remove after Leopard
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzFormatter.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzFormatter.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -171,7 +171,10 @@
* full `Debug.__String` format used by <xref
* linkend="Debug+debug.write"/>. `%w` format obeys <xref
* linkend="Debug+debug.printLength"/>. If a precision is specified,
- * that is used as printLength.
+ * that is used as printLength. There is an additional modifier
+ * (=) which will take the next argument as the object to be
+ * represented (i.e., linked to) by the formatted string; thus
+ * permitting custom representations.
*
* @param string control: A control string where % indicates a
* subsequent argument is to be substituted.
@@ -241,6 +244,8 @@
var length = '';
var precision = null;
var directive = null;
+ // The object that is to be represented
+ var object = null;
// var extra = null;
while ((start < limit) &&
// swf7 (! directive)
@@ -283,6 +288,11 @@
break;
case '.': precision = ''; break;
case 'h': case 'l': break;
+ case '=':
+ // Take the next argument to be the object represented
+ object = getarg(argno);
+ argno++;
+ break;
// case '{':
// // Look for a match
// var close = ctrl.indexOf('}', start);
@@ -299,6 +309,7 @@
}
}
var value = getarg(argno);
+ if (object == null) { object = value; }
// set decimals
var decimals = null;
var force = false;
@@ -359,7 +370,7 @@
switch (directive) {
case 'D': case 'U': case 'I': case 'O': case 'X': case 'F': case 'E': case 'G':
value = Number(value);
- out.append(this.pad(value, length, decimals, pad, sign, radix, force).toUpperCase());
+ out.appendInternal(this.pad(value, length, decimals, pad, sign, radix, force).toUpperCase(), object);
argno++; // consume value
break;
case 'c':
@@ -372,7 +383,7 @@
// We let __String abbreviate, for best legibility
out.appendInternal(this.pad(Debug.__String(value, true, width, alternate),
length, null, pad, sign, radix, force),
- value);
+ object);
argno++; // consume value
break;
}
@@ -394,12 +405,12 @@
str = '' + value;
}
out.appendInternal(this.pad(str, length, decimals, pad, sign, radix, force),
- value);
+ object);
argno++; // consume value
break;
case 'd': case 'u': case 'i': case 'o': case 'x': case 'f': case 'e': case 'g':
value = Number(value);
- out.append(this.pad(value, length, decimals, pad, sign, radix, force));
+ out.appendInternal(this.pad(value, length, decimals, pad, sign, radix, force), object);
argno++; // consume value
break;
case '%':
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -105,6 +105,10 @@
* @access private
*/
Debug.backtraceStack.maxDepth = 100;
+ /** Backtrace for uncaught errors
+ * @access private
+ */
+ Debug.uncaughtBacktraceStack = null;
/**
* Doc'd on real definition
@@ -327,9 +331,18 @@
* error handler
*/
if (typeof window.addEventListener == 'function') {
- // The DOM 1 interface is more useful than the DOM 2 interface.
+ // The DOM 1 interface is more useful than the DOM 2 interface
window.onerror = function (errorString, fileName, lineNo) {
-#pragma "warnUndefinedReferences=false"
+ #pragma "warnUndefinedReferences=false"
+ if (Debug.uncaughtBacktraceStack) {
+ // If backtracing has caught our stack info, use that rather
+ // than browser info
+ errorString = new String(errorString);
+ errorString.$lzsc$b = Debug.uncaughtBacktraceStack;
+ Debug.uncaughtBacktraceStack = null;
+ fileName = null;
+ lineNo = null;
+ }
$reportSourceWarning(fileName, lineNo, errorString, true);
// pass through to browser debugger
return false;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -540,7 +540,7 @@
// This is a hack because people want to give color styles as
// Ox... which is not valid CSS, so they pass it as a string.
// They really should be using #...
- if ((typeof v == 'string') && (! isNaN(v))) {
+ if ((typeof v == 'string') && (v.length > 2) && (v.indexOf('0x') == 0) && (! isNaN(v))) {
if ($debug) {
Debug.warn("Invalid CSS value for %w.%s: `%#w`. Use: `#%06x`.", this, k, v, Number(v));
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataElement.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataElement.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataElement.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -316,12 +316,14 @@
this.childNodes = children;
for ( var i = 0; i < children.length; i++ ){
var c = children[ i ];
- c.setOwnerDocument( this.ownerDocument );
- c.parentNode = this;
- if (c.onparentNode) {
- if (c.onparentNode.ready) c.onparentNode.sendEvent( this );
+ if (c) {
+ c.setOwnerDocument( this.ownerDocument );
+ c.parentNode = this;
+ if (c.onparentNode) {
+ if (c.onparentNode.ready) c.onparentNode.sendEvent( this );
+ }
+ c.__LZo = i;
}
- c.__LZo = i;
}
this.__LZcoDirty = false;
if (this.onchildNodes) {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -767,11 +767,12 @@
if (p.childNodes) {
for ( var i = 0; i < p.childNodes.length; i++ ){
- if ( p.childNodes[ i ].nodeName == name ){
+ var cn = p.childNodes[i];
+ if ( cn && cn.nodeName == name ){
//match
cnt++;
if ( !range || cnt >= range[ 0 ] ){
- o.push( p.childNodes[ i ] );
+ o.push( cn );
}
if ( range && cnt == range[ 1 ] ){
break;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -89,11 +89,13 @@
}
var firstcl = this.clones[ 0 ];
- firstcl.setOption( 'ignorelayout', true );
- var layo = firstcl.immediateparent.layouts;
- if (layo != null) {
- for ( var i = 0; i < layo.length; i++ ){
- layo[ i ].removeSubview( firstcl );
+ if (firstcl) {
+ firstcl.setOption( 'ignorelayout', true );
+ var layo = firstcl.immediateparent.layouts;
+ if (layo != null) {
+ for ( var i = 0; i < layo.length; i++ ){
+ layo[ i ].removeSubview( firstcl );
+ }
}
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -273,6 +273,7 @@
* @access private
*/
function __LZHandleCloneResize ( cl , s){
+ if (! cl.datapath.p) return;
var osize = cl.datapath.p[ this.datasizevar ] || this.viewsize;
if ( s != osize ){
cl.datapath.p[ this.datasizevar ] = s;
Copied: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMemory.lzs (from rev 7496, openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMemory.lzs)
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMessage.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMessage.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMessage.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -102,7 +102,7 @@
*/
LzMessage.prototype.concat = function () {
var msg = new LzMessage(this.message.concat.apply(this, arguments));
- var offset = 0;
+ var offset = this.message.length;
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (arg instanceof LzMessage) {
@@ -152,13 +152,22 @@
* @param Object obj: the object represented, or null
*/
LzMessage.prototype.appendInternal = function (str, obj) {
- if (arguments.length < 2) {
+ if (arguments.length < 2) {
var id = null;
} else {
var id = Debug.IDForObject(obj);
}
if (id == null) {
this.message += str;
+ } else if (obj instanceof LzMessage) {
+ // If it is already a message, just concatenate it
+ var offset = this.message.length;
+ this.message += obj.message;
+ var ao = obj.objects;
+ for (var j = 0; j < ao.length; j++) {
+ var od = ao[j];
+ this.objects.push({id: od.id, start: od.start+offset, end: od.end+offset});
+ }
} else {
var start = this.message.length;
this.message += str;
@@ -264,25 +273,33 @@
function LzSourceMessage (file, line, message) {
switch (arguments.length) {
case 0:
- file = null;
+ file = null;
case 1:
- line = null;
+ line = null;
case 2:
- message = '';
+ message = '';
}
// Append a backtrace if there is one -- skip back to the
// $reportSourceWarning or warnInternal frames.
if ('backtraceStack' in Debug) {
- var bts = Debug.backtraceStack;
- var btsl = bts.length;
- var skip = 3;
- for (var i = btsl - 1; i > skip; i--) {
- var callee = bts[i].callee;
- if (callee === $reportSourceWarning ||
- callee === Debug.warnInternal) {
- // Skip the caller and the constructor frames too
- skip = btsl - i + 3;
- break;
+ var skip;
+ if ((message instanceof String) && ('$lzsc$b' in message)) {
+ // An uncaught error reported by the window.onerror handler will
+ // have a captured stack
+ Debug.backtraceStack = message.$lzsc$b;
+ skip = 2;
+ } else {
+ var bts = Debug.backtraceStack;
+ var btsl = bts.length;
+ skip = 3;
+ for (var i = btsl - 1; i > skip; i--) {
+ var callee = bts[i].callee;
+ if (callee === $reportSourceWarning ||
+ callee === Debug.warnInternal) {
+ // Skip the caller and the constructor frames too
+ skip = btsl - i + 3;
+ break;
+ }
}
}
if (Debug.backtraceStack.length > skip) {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMonitor.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMonitor.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzMonitor.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -26,7 +26,7 @@
LzMonitor.format = LzSourceMessage.format;
LzMonitor.prototype.type = 'MONITOR';
// Same color as Debug.debug
-LzTrace.prototype.color = '#00cc00';
+LzMonitor.prototype.color = '#00cc00';
/**
* Create a monitor message from a format string
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzTrace.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzTrace.lzs 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/LzTrace.lzs 2007-12-10 22:47:57 UTC (rev 7498)
@@ -79,7 +79,7 @@
return r;
};
m._dbg_previous_definition = f;
- who[what] = m;
+ who.addProperty(what, m);
} else {
Debug.error('%w.%s is not a function', who, what);
}
@@ -98,8 +98,15 @@
if (who[what] instanceof Function) {
var f = who[what];
var p = f['_dbg_previous_definition'];
- if (p) {
- who[what] = p;
+ if (p) {
+ // Try just removing trace
+ if (who.hasOwnProperty(what)) {
+ delete who[what];
+ }
+ // If that didn't work, apply previous
+ if (who[what] !== p) {
+ who.addProperty(what, p);
+ }
} else {
Debug.error('%w.%s is not being traced', who, what);
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js 2007-12-10 22:47:57 UTC (rev 7498)
@@ -295,7 +295,7 @@
// No pretty for these, you don't know if the user toString is
// uniquifying
pretty = (! unique);
- s = String(thing);
+ s = thing.toString();
}
// Print unidentified objects and arrays as abbreviated list of props
else {
@@ -370,7 +370,9 @@
s = String(thing);
}
- if (pretty && (s != "") && (s.length < limit)) {
+ if (pretty &&
+ ((t != 'object') || (! unique)) &&
+ (s != "") && (s.length < limit)) {
return s;
}
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as 2007-12-10 22:47:57 UTC (rev 7498)
@@ -354,7 +354,7 @@
// No pretty for these, you don't know if the user toString is
// uniquifying
pretty = (! unique);
- s = String(thing);
+ s = thing.toString();
}
// Print unidentified objects and arrays as abbreviated list of props
else {
@@ -429,7 +429,9 @@
s = String(thing);
}
- if (pretty && (s != "") && (s.length < limit)) {
+ if (pretty &&
+ ((t != 'object') || (! unique))
+ && (s != "") && (s.length < limit)) {
return s;
}
// Compute id; force if you couldn't print pretty due to
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzMemory.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzMemory.as 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/debugger/platform/swf/LzMemory.as 2007-12-10 22:47:57 UTC (rev 7498)
@@ -367,135 +367,148 @@
Debug.format('Finding new objects... ');
} else {
Debug.error('Call %w first', Debug.markObjects);
-}
-}
+ }
+};
+
/**
+ * A leak descriptor
+ */
+class __LzLeak {
+ var obj = null;
+ var path = '';
+ var parent = null
+ var property = '';
+ var leaked = 0;
+
+ function initialize (o) {
+ var annotations = Debug.annotation;
+ var why = annotations.why;
+ var leaked = annotations.leaked;
+ this.obj = o;
+ if (o && (why in o) && (leaked in o)) {
+ var path = o[why];
+ var lastdot = path.lastIndexOf('.');
+ this.path = path.substring(0, lastdot);
+ this.parent = eval(this.path);
+ this.property = path.substring(lastdot + 1, path.length);
+ this.leaked = o[leaked];
+ }
+ }
+
+ /**
+ * Describe an individual leak
+ * @access private
+ */
+ function toString () {
+ if (this.obj) {
+ return Debug.formatToString("%=s.%s: (\xa3%d) %0.32#w", this.parent, this.path, this.property, this.leaked, this.obj);
+ } else {
+ return '' + this.obj;
+ }
+ }
+};
+
+/**
* Snapshot of the current leaks
* @access private
*/
-var __LzLeaks = function () {
- var l = Debug.leaks;
- var ll = l.length;
- var annotations = Debug.annotation;
- var why = annotations.why;
- var size = annotations.size;
- var leaked = '_dbg_check';
+class __LzLeaks /* extends Array */ {
+ // Act like an Array
+ var length = 0;
- // Sort leaks according to path
- l.sort(function (a, b) {
- var an = a[why];
- var bn = b[why];
- return (an > bn) - (an < bn);
- });
+ var sort = Array.prototype.sort;
- // Merge leaks under the same path
- this.length = 0;
- for (var i = 0; i < ll; i = j) {
- var p = l[i];
- p[leaked] = p[size];
- var j = i + 1;
- var pn = p[why];
- if (typeof(pn) != 'undefined') {
- while (j < ll) {
- var c = l[j];
- var cn = c[why];
- if (typeof(cn) != 'undefined') {
- if (cn.indexOf(pn) == 0) {
- // Don't count loops
- if (c !== p) {
- p[leaked] += c[size];
- } else {
- if (Debug.debugTrace) {
- Debug.format('%s is %s\n', pn, cn);
+ function initialize () {
+ var l = Debug.leaks;
+ var ll = l.length;
+ var annotations = Debug.annotation;
+ var why = annotations.why;
+ var size = annotations.size;
+ var leaked = '_dbg_check';
+
+ // Sort leaks according to path
+ l.sort(function (a, b) {
+ var an = a[why];
+ var bn = b[why];
+ return (an > bn) - (an < bn);
+ });
+
+ // Merge leaks under the same path
+ this.length = 0;
+ for (var i = 0; i < ll; i = j) {
+ var p = l[i];
+ p[leaked] = p[size];
+ var j = i + 1;
+ var pn = p[why];
+ if (typeof(pn) != 'undefined') {
+ while (j < ll) {
+ var c = l[j];
+ var cn = c[why];
+ if (typeof(cn) != 'undefined') {
+ if (cn.indexOf(pn) == 0) {
+ // Don't count loops
+ if (c !== p) {
+ p[leaked] += c[size];
+ } else {
+ if (Debug.debugTrace) {
+ Debug.format('%s is %s\n', pn, cn);
+ }
}
+ j++;
+ continue;
}
- j++;
- continue;
}
+ break;
}
- break;
}
+ this[this.length++] = new __LzLeak(p);
}
- this[this.length++] = p;
}
-}
-// An __LzLeaks is an array
-__LzLeaks.prototype = new Array();
-// Work around Flash deficiency...
-__LzLeaks.prototype.constructor = __LzLeaks;
-/**
- * Convert a leaks to a string
- * @param printer:Function the function to print the leaks
- * functions with. Defaults to Debug.__String
- * @param length:Number the length to abbreviate the string to
- *
- * @access private
- */
-__LzLeaks.prototype.toStringInternal = function(printer, length) {
- switch (arguments.length) {
- case 0:
- printer = function (o) { return Debug.__String(o); };
- case 1:
- length = Debug.printLength;
- }
- var leaks = "";
- var sep = "\n";
- for (var i = this.length - 1; i >= 0 && leaks.length < length; i--) {
- if (this[i]) {
- leaks += printer(this[i]) + sep;
+ function _dbg_name () {
+ var leakage = 0;
+ for (var i in this) {
+ var s = this[i].leaked;
+ if (! isNaN(s)) {
+ leakage += s;
+ }
}
+ return leakage + ' smoots';
}
- // Trim trailing sep
- if (leaks != '') {
- leaks = leaks.substring(0, leaks.length - sep.length);
- }
- leaks = Debug.abbreviate(leaks, length);
- return leaks;
}
/**
- * Leaks printer
+ * List new objects and why they are alive
+ *
+ * @param top Number: How many leaks to detail, default is 10
* @access private
*/
-__LzLeaks.prototype.toString = function () {
- var annotations = Debug.annotation;
- var why = annotations.why;
- var leaked = annotations.leaked;
- return this.toStringInternal(function (o) { return o[why] + ' (' + o[leaked] + '): ' + Debug.__String(o); });
-}
-
-/**
- * Name for debug
- * @access private
- */
-__LzLeaks.prototype._dbg_name = function () {
- var leaked = Debug.annotation.leaked;
- var leakage = 0;
- for (var i in this) {
- var s = this[i][leaked];
- if (! isNaN(s)) {
- leakage += s;
- }
+Debug.whyAlive = function (top) {
+ switch (arguments.length) {
+ case 0:
+ top = 10;
}
- return leakage + ' smoots';
-}
-
-
-/**
- * List new objects and why they are alive
- * @access private
- */
-Debug.whyAlive = function () {
- var leaked = this.annotation.leaked;
if (this['leaks']) {
var l = new __LzLeaks();
// Sort the largest to the top
- l.sort(function (a, b) { return a[leaked] - b[leaked] });
+ l.sort(function (a, b) {
+ var al = a.leaked;
+ var bl = b.leaked;
+ return (al < bl) - (al > bl); });
+ // Output the top leaks
+ if (top > l.length) { top = l.length; }
+ for (var i = 0; i < top; i++) {
+ Debug.format("%w\n", l[i].toString());
+ }
+ if (top < l.length) {
+ Debug.write('...');
+ }
+
+ // Return the data for inspection
return l;
} else {
Debug.error('Call %w first', Debug.findNewObjects);
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2007-12-10 22:47:57 UTC (rev 7498)
@@ -312,10 +312,10 @@
this.quirks['absolute_position_accounts_for_offset'] = true;
this.quirks['canvas_div_cannot_be_clipped'] = true;
} else if (Lz.__BrowserDetect.isFirefox && Lz.__BrowserDetect.version < 2) {
- // see http://groups.google.ca/group/netscape.public.mozilla.dom/browse_thread/thread/821271ca11a1bdbf/46c87b49c026246f?lnk=st&q=+focus+nsIAutoCompletePopup+selectedIndex&rnum=1
- this.quirks['firefox_autocomplete_bug'] = true;
+ // see http://groups.google.ca/group/netscape.public.mozilla.dom/browse_thread/thread/821271ca11a1bdbf/46c87b49c026246f?lnk=st&q=+focus+nsIAutoCompletePopup+selectedIndex&rnum=1
+ this.quirks['firefox_autocomplete_bug'] = true;
+ }
}
- }
if (this.quirks['safari_avoid_clip_position_input_text']) {
LzSprite.prototype.__defaultStyles.lzswfinputtext.marginTop = '-2px';
@@ -577,8 +577,9 @@
this.__setClickable(c, this.__LZclick);
if (this.quirks.fix_clickable) {
if (this.quirks.fix_ie_clickable) {
- this.__LZclickdiv.style.display = c ? '' : 'none';
- this.__LZclick.style.display = c ? '' : 'none';
+ //note: views with resources (__LZimg!) cannot have subviews (SWF-policy)
+ this.__LZclickdiv.style.display = c && this.visible ? '' : 'none';
+ this.__LZclick.style.display = c && this.visible ? '' : 'none';
} else {
this.__LZclick.style.display = c ? 'block' : 'none';
}
@@ -602,7 +603,7 @@
}
this.__setClickable(c, this.__LZclick);
if (this.quirks.fix_ie_clickable) {
- this.__LZclick.style.display = c ? '' : 'none';
+ this.__LZclick.style.display = c && this.visible ? '' : 'none';
} else {
this.__LZclick.style.display = c ? 'block' : 'none';
}
@@ -793,11 +794,10 @@
this.visible = v;
this.__LZdiv.style.display = v ? 'block' : 'none';
if (this.quirks.fix_clickable) {
- if (this.__LZclick && this.quirks.fix_ie_clickable) {
- this.__LZclick.style.display = v ? '' : 'none';
- } else {
- this.__LZclickdiv.style.display = v ? 'block' : 'none';
+ if (this.quirks.fix_ie_clickable && this.__LZclick) {
+ this.__LZclick.style.display = v && this.clickable ? '' : 'none';
}
+ this.__LZclickdiv.style.display = v ? 'block' : 'none';
}
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-12-10 22:47:57 UTC (rev 7498)
@@ -915,17 +915,13 @@
*
*/
LzSprite.prototype.destroy = function(recursive){
- /* This does not work!
- * -> Every subview of this sprite's owner has already removed itself, see LzView#destroy(..).
- * Therefore "this.owner.subviews" will be an empty array at this stage!
- */
- /*if (recursive) {
+ if (recursive) {
if (this.owner.subviews) {
for (var i = 0; i < this.owner.subviews.length; i++) {
this.owner.subviews[i].sprite.destroy(recursive);
}
}
- }*/
+ }
this.__LZFinishDestroyOnIdle();
}
@@ -1572,14 +1568,22 @@
}
// [todo hqm 01-24-07] SWF-specific
- var mb = this.__LZbgRef;
- if (mb == null) {
- this.setBGColor(0xffffff);
+ if (this.owner == canvas) {
+ // if this is the canvas sprite
+ var mc = this.getMCRef();
+ if (mc != null) {
+ mc.menu = cmenu;
+ }
+ } else {
var mb = this.__LZbgRef;
- mb._alpha = 0;
+ if (mb == null) {
+ this.setBGColor(0xffffff);
+ var mb = this.__LZbgRef;
+ mb._alpha = 0;
+ }
+ this._bgcolorhidden = true;
+ mb.menu = cmenu;
}
- this._bgcolorhidden = true;
- mb.menu = cmenu;
if (mb == null && mc == null) {
if ($debug) Debug.warn("LzView.setContextMenu: cannot set menu on view %w, it has no foreground or background movieclip", this.owner);
Modified: openlaszlo/branches/devildog/WEB-INF/lps/schema/lfc.lzx
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/schema/lfc.lzx 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/schema/lfc.lzx 2007-12-10 22:47:57 UTC (rev 7498)
@@ -69,6 +69,8 @@
<attribute name="version" type="string" value="4.1"/>
<!-- If true, enable accessibility features -->
<attribute name="accessible" type="boolean" value="false"/>
+ <!-- Set recursion and timeout limits -->
+ <attribute name="scriptlimits" type="css" />
<containsElements>
<element>view</element>
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/build.xml
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/build.xml 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/build.xml 2007-12-10 22:47:57 UTC (rev 7498)
@@ -416,6 +416,7 @@
<!--=============== Target [js2doc.test] =================-->
<target name="js2doc.test" depends="build,js2doc.rng" if="hasdom3">
<!-- first unit/integration tests -->
+
<junit haltonfailure="true" printsummary="withOutAndErr" showoutput="true" fork="yes">
<formatter type="plain" usefile="false"/>
<sysproperty key="LPS_HOME" value="${LPS_HOME}"/>
@@ -428,7 +429,9 @@
</classpath>
<test name="org.openlaszlo.js2doc.Comment_Test"/>
<test name="org.openlaszlo.js2doc.Schema_Test"/>
- <test name="org.openlaszlo.js2doc.JS2Doc_Test"/>
+ <!--
+ <test name="org.openlaszlo.js2doc.JS2Doc_Test"/> [2007.12.03 bshine bug LPP-5184]
+ -->
<test name="org.openlaszlo.js2doc.WholeFile_Test"/>
</junit>
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -20,12 +20,13 @@
int recursion = 0;
int timeout = 0;
- int DEFAULT_RECURSION = 1024; // pixels
- int DEFAULT_TIMEOUT = 60;
+ // Determined empirically
+ public static int DEFAULT_RECURSION = 256;
+ public static int DEFAULT_TIMEOUT = 15;
- public ScriptLimits(int recursion,int timeout) {
- this.recursion = recursion;
- this.timeout = timeout;
+ public ScriptLimits(int recursion, int timeout) {
+ this.recursion = (recursion == 0 ? DEFAULT_RECURSION : recursion);
+ this.timeout = (timeout == 0 ? DEFAULT_TIMEOUT : timeout);
}
public ScriptLimits() {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt 2007-12-10 22:47:57 UTC (rev 7498)
@@ -173,6 +173,7 @@
| < CLASS: "class" >
| < CONST: "const" >
| < DEBUGGER: "debugger" >
+| < DYNAMIC: "dynamic" >
| < ENUM: "enum" >
| < EXPORT: "export" >
| < EXTENDS: "extends" >
@@ -181,6 +182,11 @@
| < IMPORT: "import" >
| < INHERITS: "inherits" >
| < INTERFACE: "interface" >
+| < INTERNAL: "internal" >
+| < OVERRIDE: "override" >
+| < PRIVATE: "private" >
+| < PROTECTED: "protected" >
+| < PUBLIC: "public" >
| < STATIC: "static" >
| < SUPER: "super" >
| < TRAIT: "trait" >
@@ -663,14 +669,23 @@
}
}
+ASTIdentifier.Type TypeIdentifierOrVoid() #void : { ASTIdentifier.Type type = null; }
+{
+ (
+ "void" {type = null;}
+ | type = TypeIdentifier()
+ ) {
+ return type;
+ }
+}
+
ASTIdentifier.Type TypeIdentifier() #void : { Token t; ASTIdentifier.Type type = new ASTIdentifier.Type(); }
{
(
- Nullable() {type.nullable = true; }
- t = <IDENTIFIER> {type.typeName = t.image;}
- |
- t = <IDENTIFIER> {type.typeName = t.image;}
- [NotNullable() {type.notnullable = true; }]
+ t = <IDENTIFIER> {type.typeName = t.image;}
+ [ NotNullable() {type.notnullable = true; }
+ | Nullable() {type.nullable = true; }
+ ]
) {
return type;
}
@@ -836,25 +851,33 @@
// Function declaration
-void FunctionDeclaration() #FunctionDeclaration : {ASTIdentifier id; ASTIdentifier.Type type;}
+void FunctionDeclaration() #FunctionDeclaration : {ASTFormalParameterList formals; ASTIdentifier.Type type;}
{
- "function" id = Identifier()
- [":" type = TypeIdentifier() { id.setType(type); }]
- ("(" [FormalParameterList()] ")") #FormalParameterList(jjtree.nodeArity()==0)
+ "function" Identifier()
+ formals = FormalParameterList()
+ [":" type = TypeIdentifierOrVoid() { formals.setReturnType(type); }]
Block()
}
-void FunctionExpression() #FunctionExpression : {}
+void FunctionExpression() #FunctionExpression : {ASTFormalParameterList formals; ASTIdentifier.Type type;}
{
- "function" (Identifier())? ("(" [FormalParameterList()] ")") #FormalParameterList(jjtree.nodeArity()==0) Block()
+ "function" (Identifier())?
+ formals = FormalParameterList()
+ [":" type = TypeIdentifierOrVoid() { formals.setReturnType(type); }]
+ Block()
}
-SimpleNode FormalParameterList() #FormalParameterList : {Token t;}
+ASTFormalParameterList FormalParameterList() #FormalParameterList : {}
{
- FormalParameter() ("," FormalParameter())*
+ "(" [FormalParameters()] ")"
{ return jjtThis; }
}
+void FormalParameters() : {}
+{
+ FormalParameter() ("," FormalParameter())*
+}
+
void FormalParameter() #void : {ASTIdentifier id; ASTIdentifier.Type type;}
{
id = Identifier() [":" type = TypeIdentifier() { id.setType(type); }]
@@ -868,13 +891,17 @@
{ return jjtThis; }
}
+void ModifiedDefinition() #ModifiedDefinition : {}
+{
+ Modifiers(jjtThis) (FunctionDeclaration() | ClassDefinition())
+}
+
void Directive() #void : {}
{
// Lookahead so that 'function' begins a function declaration,
// not a function expression.
- LOOKAHEAD(1)
- FunctionDeclaration()
-| ClassDefinition()
+ LOOKAHEAD(ModifiedDefinition())
+ ModifiedDefinition()
| LOOKAHEAD("{") DirectiveBlock()
| (ToplevelStatement()) #Statement
| LOOKAHEAD(2) IncludeDirective() Sc()
@@ -889,7 +916,7 @@
SimpleNode StatementList() #StatementList : {Token t;}
{
- ( ClassDefinition() | LOOKAHEAD(1) FunctionDeclaration() | Statement() | PragmaDirective())+
+ ( LOOKAHEAD(ModifiedDefinition()) ModifiedDefinition() | Statement() | PragmaDirective())+
{ return jjtThis; }
}
@@ -917,9 +944,9 @@
// TBD: verify that the next token isn't a line break
}
-SimpleNode ClassProperty() #ClassProperty : {Token t;}
+SimpleNode ClassProperty() #ModifiedDefinition : {}
{
- "static" (FunctionDeclaration() | VariableStatement())
+ Modifiers(jjtThis) (FunctionDeclaration() | VariableStatement())
{return jjtThis; }
}
@@ -938,9 +965,7 @@
void ClassDirective() #void : {}
{
- ClassProperty()
- | LOOKAHEAD(1) FunctionDeclaration()
- | LOOKAHEAD(1) VariableStatement()
+ LOOKAHEAD(ClassProperty()) ClassProperty()
| LOOKAHEAD("{") ClassDirectiveBlock()
| (ToplevelStatement()) #Statement
| PragmaDirective() Sc()
@@ -970,3 +995,30 @@
)* "}"
{return jjtThis;}
}
+
+void Modifiers(ASTModifiedDefinition mod): { Token t; }
+{
+ (
+ LOOKAHEAD(2)
+ (
+ t = <IDENTIFIER>
+ {mod.setToken(t).setNamespace(t.image); }
+ | t = "public"
+ {mod.setToken(t).setAccess(ASTModifiedDefinition.PUBLIC_ACCESS);}
+ | t = "protected"
+ {mod.setToken(t).setAccess(ASTModifiedDefinition.PROTECTED_ACCESS);}
+ | t = "internal"
+ {mod.setToken(t).setAccess(ASTModifiedDefinition.INTERNAL_ACCESS);}
+ | t = "private"
+ {mod.setToken(t).setAccess(ASTModifiedDefinition.PRIVATE_ACCESS);}
+ | t = "static"
+ {mod.setToken(t).setStatic(true);}
+ | t = "final"
+ {mod.setToken(t).setFinal(true);}
+ | t = "dynamic"
+ {mod.setToken(t).setDynamic(true);}
+ | t = "override"
+ {mod.setToken(t).setOverride(true);}
+ )
+ )*
+}
Copied: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTFormalParameterList.java (from rev 7496, openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTFormalParameterList.java)
Copied: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java (from rev 7496, openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java)
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -110,7 +110,7 @@
private String mTitle = DEFAULT_TITLE;
/** Version of the flash player file format which we compile to **/
- private String mRuntime = LPS.getProperty("compiler.runtime.default", "swf7");
+ private String mRuntime = LPS.getProperty("compiler.runtime.default", LPS.getRuntimeDefault() );
/** computed debug flag, based on canvas 'debug' attribute + compilation request args **/
private boolean mDebug = false;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -19,6 +19,7 @@
import org.openlaszlo.utils.*;
import org.jdom.*;
import org.apache.log4j.*;
+import org.openlaszlo.css.CSSParser;
/** Compiler for the <code>canvas</code> element. */
class CanvasCompiler extends ToplevelCompiler {
@@ -96,6 +97,24 @@
mEnv.warn(msg, element);
}
+ String scriptLimits = element.getAttributeValue("scriptlimits");
+ if (scriptLimits != null) {
+ try {
+ Map properties = new CSSParser(new AttributeStream(element, "scriptlimits")).Parse();
+ int recursion =
+ properties.containsKey("recursion") ?
+ ((Integer)properties.get("recursion")).intValue() : 0;
+ int timeout =
+ properties.containsKey("timeout") ?
+ ((Integer)properties.get("timeout")).intValue() : 0;
+ mEnv.setScriptLimits(recursion, timeout);
+ } catch (org.openlaszlo.css.ParseException e) {
+ throw new CompilationError(e);
+ } catch (org.openlaszlo.css.TokenMgrError e) {
+ throw new CompilationError(e);
+ }
+ }
+
if (mEnv.isSWF()) {
String baseLibraryName = getBaseLibraryName(mEnv);
String baseLibraryBecause = "Required for all applications";
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -111,7 +111,9 @@
String scacheDir = LPS.getWorkDirectory() + File.separator + "scache";
ScriptCompiler.initScriptCompilerCache(new File(scacheDir), new Properties());
// Set default runtime to compiler.runtime.default
- compiler.setProperty(CompilationEnvironment.RUNTIME_PROPERTY, LPS.getProperty("compiler.runtime.default", "swf7"));
+ compiler.setProperty(CompilationEnvironment.RUNTIME_PROPERTY,
+ LPS.getProperty("compiler.runtime.default",
+ LPS.getRuntimeDefault()));
boolean flushScriptCache = false;
for (int i = 0; i < args.length; i++) {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -260,6 +260,14 @@
SetBackgroundColor setbgc = new SetBackgroundColor(c);
mFlashFile.getMainScript().setBackgroundColor(setbgc);
+ // Write scriptlimits tag if requested
+ if ((this.mRecursionLimit != 0) || (this.mExecutionTimeout != 0)) {
+ // ScriptLimits tag, to set max recursion depth and timeout
+ Frame frame = mFlashFile.getMainScript().getFrameAt(mLastFrame);
+ ScriptLimits slimit = new ScriptLimits(this.mRecursionLimit, this.mExecutionTimeout);
+ frame.addFlashObject(slimit);
+ }
+
// NOTE: disable constant pool when compiling canvas constructor
// so that build id etc... are easy for qa to pick out.
Properties props = (Properties)mProperties.clone();
@@ -825,16 +833,6 @@
return s2;
}
- public void setScriptLimits(int recursion, int timeout) {
- this.mRecursionLimit = recursion;
- this.mExecutionTimeout = timeout;
- // ScriptLimits tag, to set max recursion depth and timeout
- Frame frame = mFlashFile.getMainScript().getFrameAt(0);
- ScriptLimits slimit = new ScriptLimits(recursion, timeout);
- frame.addFlashObject(slimit);
- }
-
-
/** Writes the SWF to the <code>OutputStream</code> that was
* supplied to the SWFWriter's constructor.
* @throws IOException if an error occurs
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2Doc.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2Doc.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2Doc.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -97,13 +97,15 @@
} else if (parseNode instanceof ASTFunctionDeclaration) {
visitFunctionDeclaration(parseNode, docNode);
} else if (parseNode instanceof ASTClassDefinition) {
- visitClassDeclaration(parseNode, docNode);
+ visitClassDeclaration(parseNode, docNode, null);
} else if (parseNode instanceof ASTIfDirective) {
visitTopLevelIfDirective(parseNode, docNode);
} else if (parseNode instanceof ASTIncludeDirective) {
visitIncludeDirective(parseNode, docNode, true);
} else if (parseNode instanceof ASTCallExpression) {
visitCallExpression(parseNode, docNode);
+ } else if (parseNode instanceof ASTModifiedDefinition) {
+ visitModifiedDefinition(parseNode, docNode);
} else if (parseNode instanceof ASTPragmaDirective) {
// do nothing
} else {
@@ -317,16 +319,18 @@
logger.warning("tried to redefine function but couldn't resolve function name");
}
- protected void visitClassDeclaration(SimpleNode parseNode, org.w3c.dom.Element docNode) {
+ protected void visitClassDeclaration(SimpleNode parseNode, org.w3c.dom.Element docNode, ASTModifiedDefinition moddef) {
SimpleNode[] children = parseNode.getChildren();
checkChildrenLowerBounds(parseNode, 2, 0, "visitClassDefinition");
ASTIdentifier nameNode = (ASTIdentifier) children[1];
String className = nameNode.getName();
+ SimpleNode parseNodeForDoc = (moddef != null) ? moddef : parseNode;
+
PropertyReference propRef = new PropertyReference(docNode, className, this.currentState);
- org.w3c.dom.Element property = propRef.redefineProperty(parseNode.getComment());
+ org.w3c.dom.Element property = propRef.redefineProperty(parseNodeForDoc.getComment());
if (this.unitID != null)
property.setAttribute("unitid", unitID);
@@ -347,7 +351,7 @@
final int n = children.length;
for (int i=4; i<n; i++) {
SimpleNode decl = children[i];
- this.visitClassStatement(decl, classNode);
+ this.visitClassStatement(decl, classNode, null);
}
} finally {
this.objectID = oldObjectID;
@@ -356,19 +360,17 @@
}
}
- protected void visitClassStatement(SimpleNode parseNode, org.w3c.dom.Element docNode) {
+ protected void visitClassStatement(SimpleNode parseNode, org.w3c.dom.Element docNode, ASTModifiedDefinition moddef) {
if (parseNode instanceof ASTStatement ||
parseNode instanceof ASTClassDirectiveBlock) {
SimpleNode[] children = parseNode.getChildren();
for (int i = 0; i < children.length; i++) {
- this.visitClassStatement(children[i], docNode);
+ this.visitClassStatement(children[i], docNode, null);
}
} else if (parseNode instanceof ASTVariableStatement) {
- visitFieldStatement(parseNode, docNode, false, null);
+ visitFieldStatement(parseNode, docNode, moddef, null);
} else if (parseNode instanceof ASTFunctionDeclaration) {
- visitMethodDeclaration(parseNode, docNode, false, null);
- } else if (parseNode instanceof ASTClassProperty) {
- visitClassProperty(parseNode, docNode);
+ visitMethodDeclaration(parseNode, docNode, moddef, null);
} else if (parseNode instanceof ASTCallExpression) {
visitCallExpression(parseNode, docNode);
} else if (parseNode instanceof ASTAssignmentExpression) {
@@ -377,6 +379,8 @@
visitClassIfDirective(parseNode, docNode);
} else if (parseNode instanceof ASTIncludeDirective) {
visitIncludeDirective(parseNode, docNode, false);
+ } else if (parseNode instanceof ASTModifiedDefinition) {
+ visitModifiedDefinition(parseNode, docNode);
} else if (parseNode instanceof ASTPragmaDirective) {
// do nothing
} else {
@@ -384,12 +388,12 @@
}
}
- protected void visitFieldStatement(SimpleNode parseNode, org.w3c.dom.Element docNode, boolean isStatic, String commonComment) {
+ protected void visitFieldStatement(SimpleNode parseNode, org.w3c.dom.Element docNode, ASTModifiedDefinition moddef, String commonComment) {
VariableDeclarationsInfo decls = collectVariableDeclarations(parseNode);
String comment = (decls.commonComment != null) ? decls.commonComment : commonComment;
SimpleNode[] vars = decls.variables;
for (int i = 0; i < vars.length; i++) {
- this.visitFieldDeclaration(vars[i], docNode, comment, isStatic);
+ this.visitFieldDeclaration(vars[i], docNode, comment, moddef.isStatic());
}
}
@@ -440,7 +444,7 @@
}
}
- protected void visitMethodDeclaration(SimpleNode parseNode, org.w3c.dom.Element docNode, boolean isStatic, String comment) {
+ protected void visitMethodDeclaration(SimpleNode parseNode, org.w3c.dom.Element docNode, ASTModifiedDefinition moddef, String comment) {
SimpleNode[] children = parseNode.getChildren();
checkChildrenLowerBounds(parseNode, 3, 3, "visitMethodDeclaration");
@@ -449,7 +453,7 @@
org.w3c.dom.Element targetNode = docNode;
- if (isStatic == false)
+ if (moddef.isStatic() == false)
targetNode = this.ensurePrototypeNode(docNode);
if (targetNode != null) {
@@ -468,17 +472,20 @@
}
}
- protected void visitClassProperty(SimpleNode parseNode, org.w3c.dom.Element docNode) {
+ protected void visitModifiedDefinition(SimpleNode parseNode, org.w3c.dom.Element docNode) {
SimpleNode[] children = parseNode.getChildren();
- checkChildrenLowerBounds(parseNode, 1, 1, "visitClassProperty");
+ checkChildrenLowerBounds(parseNode, 1, 1, "visitModifiedDefinition");
String comment = parseNode.getComment();
+ ASTModifiedDefinition moddef = (ASTModifiedDefinition)parseNode;
SimpleNode child = children[0];
if (child instanceof ASTVariableStatement)
- this.visitFieldStatement(child, docNode, true, comment);
+ this.visitFieldStatement(child, docNode, moddef, comment);
else if (child instanceof ASTFunctionDeclaration)
- this.visitMethodDeclaration(child, docNode, true, comment);
+ this.visitMethodDeclaration(child, docNode, moddef, comment);
+ else if (child instanceof ASTClassDefinition)
+ this.visitClassDeclaration(child, docNode, moddef);
else
throw new InternalError("Unexpected node type " + parseNode.getClass().getName(), parseNode);
}
@@ -624,7 +631,7 @@
if (isTopLevel)
this.visitToplevelStatement(trueDirective, docNode);
else
- this.visitClassStatement(trueDirective, docNode);
+ this.visitClassStatement(trueDirective, docNode, null);
} finally {
this.currentState = previousState;
}
@@ -647,7 +654,7 @@
if (isTopLevel)
this.visitToplevelStatement(condChild, docNode);
else
- this.visitClassStatement(condChild, docNode);
+ this.visitClassStatement(condChild, docNode, null);
}
} finally {
this.currentState = previousState;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -275,10 +275,11 @@
static void checkChildrenLowerBounds(SimpleNode node, int min, int expectedMax, String methodName) {
SimpleNode[] children = node.getChildren();
+
if (children.length < min) {
logger.throwing("JS2Doc", methodName, new InternalError("Too few child nodes in " + node.getClass().getName(), node));
} else if (expectedMax > 0 && children.length > expectedMax) {
- logger.warning("Unexpected number of child nodes in " + node.getClass().getName());
+ logger.fine("Unexpected number of child nodes in " + node.getClass().getName());
}
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -449,6 +449,8 @@
visitStatement(directive);
} else if (directive instanceof ASTClassDefinition) {
visitClassDefinition(directive, directive.getChildren());
+ } else if (directive instanceof ASTModifiedDefinition) {
+ visitModifiedDefinition(directive, directive.getChildren());
} else if (directive instanceof ASTStatement) {
// Statements are processed in pass 1 for now
visitStatement(directive);
@@ -1273,6 +1275,23 @@
return translateReference(node).get().node;
}
+ void noteCallSite (SimpleNode node) {
+ // Note current call-site in a function context and backtracing
+ if ((options.getBoolean(Compiler.DEBUG_BACKTRACE) && (node.beginLine != 0)) &&
+ (context.findFunctionContext() != null)) {
+ Map registers = (Map)context.get(TranslationContext.REGISTERS);
+ // We know arguments register will exist if we are doing
+ // bactraces because it will be referenced in the function
+ // prefix.
+ if (registers != null && registers.containsKey("arguments")) {
+ collector.push(Values.Register(((Instructions.Register)registers.get("arguments")).regno));
+ collector.push("lineno");
+ collector.push(node.beginLine);
+ collector.emit(Instructions.SetMember);
+ }
+ }
+ }
+
public SimpleNode visitCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode fnexpr = children[0];
SimpleNode[] args = children[1].getChildren();
@@ -1443,21 +1462,7 @@
}
}
- // Note current call-site in a function context and backtracing
- if ((options.getBoolean(Compiler.DEBUG_BACKTRACE) && (node.beginLine != 0)) &&
- (context.findFunctionContext() != null)) {
- Map registers = (Map)context.get(TranslationContext.REGISTERS);
- // We know arguments register will exist if we are doing
- // bactraces because it will be referenced in the function
- // prefix.
- if (registers != null && registers.containsKey("arguments")) {
- collector.push(Values.Register(((Instructions.Register)registers.get("arguments")).regno));
- collector.push("lineno");
- collector.push(node.beginLine);
- collector.emit(Instructions.SetMember);
- }
- }
-
+ noteCallSite(node);
// Okay, it is not going to be transformed. Just do it!
visitFunctionCallParameters(node, isReferenced, args);
boolean isref = translateReferenceForCall(fnexpr, true, node);
@@ -1485,6 +1490,7 @@
public SimpleNode visitNewExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode ref = children[0];
SimpleNode[] args = children[1].getChildren();
+ noteCallSite(node);
visitFunctionCallParameters(node, isReferenced, args);
boolean isref = translateReferenceForCall(ref, true, node);
if (isref) {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -392,9 +392,17 @@
for (int i = 0; i < dirs.length; i++) {
SimpleNode n = dirs[i];
List p = props;
- if (n instanceof ASTClassProperty) {
+
+ // any modifiers, like 'static', 'final' are kept in mod.
+ ASTModifiedDefinition mod = null;
+ if (n instanceof ASTModifiedDefinition) {
+ assert (n.getChildren().length == 1);
+ mod = (ASTModifiedDefinition)n;
+ if (mod.isStatic()) {
+ p = classProps;
+ }
n = n.get(0);
- p = classProps;
+ mod.verifyClassLevel(n);
}
if (n instanceof ASTFunctionDeclaration) {
SimpleNode[] c = n.getChildren();
@@ -542,6 +550,9 @@
else if (node instanceof ASTSwitchStatement) {
newNode = visitSwitchStatement(node, children);
}
+ else if (node instanceof ASTModifiedDefinition) {
+ newNode = visitModifiedDefinition(node, children);
+ }
else if (node instanceof Compiler.PassThroughNode) {
newNode = node;
} else {
@@ -592,6 +603,18 @@
return visitStatementList(node, children);
}
+ public SimpleNode visitModifiedDefinition(SimpleNode node, SimpleNode[] children) {
+ // Modifiers, like 'final', are ignored unless this is handled
+ // by the runtime.
+
+ assert children.length == 1;
+ SimpleNode child = children[0];
+
+ ((ASTModifiedDefinition)node).verifyTopLevel(child);
+
+ return visitStatement(child);
+ }
+
public SimpleNode visitLabeledStatement(SimpleNode node, SimpleNode[] children) {
ASTIdentifier name = (ASTIdentifier)children[0];
SimpleNode stmt = children[1];
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -66,7 +66,7 @@
options.putBoolean(OBFUSCATE, false);
}
if (! options.containsKey(RUNTIME)) {
- options.put(RUNTIME, LPS.getProperty("compiler.runtime.default", "swf7"));
+ options.put(RUNTIME, LPS.getProperty("compiler.runtime.default", LPS.getRuntimeDefault()));
}
defaultOptions();
if (options.getBoolean(PRINT_COMPILER_OPTIONS)) {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2007-12-10 22:47:57 UTC (rev 7498)
@@ -289,6 +289,8 @@
newDirective = visitStatement(directive);
} else if (directive instanceof ASTClassDefinition) {
newDirective = visitStatement(directive);
+ } else if (directive instanceof ASTModifiedDefinition) {
+ newDirective = visitModifiedDefinition(directive, directive.getChildren());
} else if (directive instanceof ASTStatement) {
// Statements are processed in pass 1 for now
newDirective = visitStatement(directive);
@@ -819,6 +821,18 @@
return node;
}
+ SimpleNode noteCallSite(SimpleNode node) {
+ // Note current call-site in a function context and backtracing
+ if ((options.getBoolean(Compiler.DEBUG_BACKTRACE) && (node.beginLine != 0)) &&
+ (context.findFunctionContext() != null)) {
+ SimpleNode newNode = new ASTExpressionList(0);
+ newNode.set(0, (new Compiler.Parser()).parse("$lzsc$a.lineno = " + node.beginLine).get(0).get(0));
+ newNode.set(1, new Compiler.PassThroughNode(node));
+ return visitExpression(newNode);
+ }
+ return node;
+ }
+
// Could do inline expansions here, like setAttribute
public SimpleNode visitCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode fnexpr = children[0];
@@ -911,15 +925,7 @@
// if (options.getBoolean(Compiler.WARN_UNDEFINED_REFERENCES)) {
// return makeCheckedNode(node);
// }
- // Note current call-site in a function context and backtracing
- if ((options.getBoolean(Compiler.DEBUG_BACKTRACE) && (node.beginLine != 0)) &&
- (context.findFunctionContext() != null)) {
- SimpleNode newNode = new ASTExpressionList(0);
- newNode.set(0, (new Compiler.Parser()).parse("$lzsc$a.lineno = " + node.beginLine).get(0).get(0));
- newNode.set(1, new Compiler.PassThroughNode(node));
- return visitExpression(newNode);
- }
- return node;
+ return noteCallSite(node);
}
public SimpleNode visitSuperCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
@@ -932,7 +938,7 @@
SimpleNode child = children[i];
children[i] = visitExpression(child, isReferenced);
}
- return node;
+ return noteCallSite(node);
}
public SimpleNode visitPrefixExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
@@ -1180,17 +1186,23 @@
}
}
List prefix = new ArrayList();
+ List error = new ArrayList();
List suffix = new ArrayList();
if (options.getBoolean(Compiler.DEBUG_BACKTRACE)) {
prefix.add(parseFragment(
- "var $lzsc$s = Debug['backtraceStack'];" +
+ "var $lzsc$d = Debug, $lzsc$s = $lzsc$d.backtraceStack;" +
"if ($lzsc$s) {" +
" var $lzsc$a = Array.prototype.slice.call(arguments, 0);" +
" $lzsc$a.callee = arguments.callee;" +
" $lzsc$a['this'] = this;" +
" $lzsc$s.push($lzsc$a);" +
- " if ($lzsc$s.length > $lzsc$s.maxDepth) {Debug.stackOverflow()};" +
+ " if ($lzsc$s.length > $lzsc$s.maxDepth) {$lzsc$d.stackOverflow()};" +
"}"));
+ error.add(parseFragment(
+ "if ($lzsc$s && (! $lzsc$d.uncaughtBacktraceStack)) {" +
+ " $lzsc$d.uncaughtBacktraceStack = $lzsc$s.slice(0);" +
+ "}" +
+ "throw($lzsc$e);"));
suffix.add(parseFragment(
"if ($lzsc$s) {" +
" $lzsc$s.pop();" +
@@ -1388,16 +1400,27 @@
// FIXME: (LPP-2075) [2006-05-19 ptw] Wrap body in try and make
// suffix be a finally clause, so suffix will not be skipped by
// inner returns.
- if (! suffix.isEmpty()) {
+ if (! suffix.isEmpty() || ! error.isEmpty()) {
+ int i = 0;
SimpleNode newStmts = new ASTStatementList(0);
newStmts.setChildren((SimpleNode[])newBody.toArray(new SimpleNode[0]));
SimpleNode tryNode = new ASTTryStatement(0);
- tryNode.set(0, newStmts);
- SimpleNode finallyNode = new ASTFinallyClause(0);
- SimpleNode suffixStmts = new ASTStatementList(0);
- suffixStmts.setChildren((SimpleNode[])suffix.toArray(new SimpleNode[0]));
- finallyNode.set(0, suffixStmts);
- tryNode.set(1, finallyNode);
+ tryNode.set(i++, newStmts);
+ if (! error.isEmpty()) {
+ SimpleNode catchNode = new ASTCatchClause(0);
+ SimpleNode catchStmts = new ASTStatementList(0);
+ catchStmts.setChildren((SimpleNode[])error.toArray(new SimpleNode[0]));
+ catchNode.set(0, new ASTIdentifier("$lzsc$e"));
+ catchNode.set(1, catchStmts);
+ tryNode.set(i++, catchNode);
+ }
+ if (! suffix.isEmpty()) {
+ SimpleNode finallyNode = new ASTFinallyClause(0);
+ SimpleNode suffixStmts = new ASTStatementList(0);
+ suffixStmts.setChildren((SimpleNode[])suffix.toArray(new SimpleNode[0]));
+ finallyNode.set(0, suffixStmts);
+ tryNode.set(i, finallyNode);
+ }
newBody = new ArrayList();
newBody.add(tryNode);
}
Modified: openlaszlo/branches/devildog/docs/includes/styles.css
===================================================================
--- openlaszlo/branches/devildog/docs/includes/styles.css 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/includes/styles.css 2007-12-10 22:47:57 UTC (rev 7498)
@@ -73,7 +73,7 @@
}
dt {
- background-color: #EEEEEE;
+ background-color: #ffffff;
padding-left: 2px;
padding-top: 2px;
padding-bottom: 2px;
Modified: openlaszlo/branches/devildog/docs/src/deployers/deploy-preface.dbk
===================================================================
--- openlaszlo/branches/devildog/docs/src/deployers/deploy-preface.dbk 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/deployers/deploy-preface.dbk 2007-12-10 22:47:57 UTC (rev 7498)
@@ -55,12 +55,10 @@
<itemizedlist spacing="compact"><listitem>
<!-- change title per LPP-4804, IORIO 16 oct 2007 -->
<para>The <ulink url="../developers"><emphasis role="em">OpenLaszlo Application Developer's Guide</emphasis></ulink>, the comprehensive
-explanation of how to write and test OpenLaszlo programs.</para></listitem><listitem><para>The <ulink url="../design"><emphasis role="em">User Interface Designer's Guide to Laszlo Applications</emphasis></ulink>,
-which addresses aspects
-of the Laszlo platform that are of special interest to UI and graphic designers</para></listitem><listitem><para>The <ulink url="../reference/../reference/" type="laszlo-reference"><emphasis role="em">LZX Reference
+ explanation of how to write and test OpenLaszlo programs.</para></listitem><listitem><para>The <ulink url="../reference/"><emphasis role="em">LZX Reference
Manual</emphasis></ulink>. This online, hyperlinked, comprehensive reference
for LZX contains entries for each LZX tag and API. Its format will
- be familiar to users of JavaDoc(tm) and similar systems. </para></listitem><listitem><para>The <ulink url="../guide/" type="laszlo-dguide">online tutorials</ulink> and sample
+ be familiar to users of JavaDoc(tm) and similar systems. </para></listitem><listitem><para>The <ulink url="../developers/" >online tutorials</ulink> and sample
applications at <ulink url="http://www.laszlosystems.com/demos">http://www.laszlosystems.com/demos</ulink>
provide a hands-on instructional overview of the LZX language.</para></listitem></itemizedlist>
Modified: openlaszlo/branches/devildog/docs/src/deployers/deployers-guide.dbk
===================================================================
--- openlaszlo/branches/devildog/docs/src/deployers/deployers-guide.dbk 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/deployers/deployers-guide.dbk 2007-12-10 22:47:57 UTC (rev 7498)
@@ -647,9 +647,9 @@
<para>will leave the log in the default location inside the web applications's
WEB-INF directory. You can also modify the amount of logging done by
changing the priority of your logger from <literal>info</literal> to
-<literal>debug</literal>. For more details on this file see the <ulink url="http://jakarta.apache.org/log4j/docs/manual.html">online manual</ulink> and
-the <ulink url="http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/Log4JXmlFormat">xml
-configurator primer</ulink>. There's also the <ulink url="http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html">detailed
+ <literal>debug</literal>. For more details on this file see the
+ <ulink url="http://logging.apache.org/log4j/1.2/index.html">online manual</ulink>
+ There's also the <ulink url="http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html">detailed
doc</ulink> about the pattern layout for controlling the format of each log
statement. The default settings will keep 5 backup log files each with a maximum
size of 10 MBytes. You can change them by using the MaxBackupIndex param and
@@ -812,9 +812,9 @@
in your LPS directory by using a query such as, for example,
<literal>http://127.0.0.1:8080/lps/lps/utils/viewer/viewer.jsp?file=/examples/tag-definition.lzx</literal>.</para>
-<para>To prevent this, remove or rename the <literal>viewer</literal> directory from the <literal>lps/lps/utils</literal> directory and set <literal>allowRequestSOURCE=false</literal> in the<ulink url="lps.properties"> file.</ulink>
+<para>To prevent this, remove or rename the <literal>viewer</literal> directory from the <literal>lps/lps/utils</literal> directory and set <literal>allowRequestSOURCE=false</literal> in the <xref linkend="deployers-guide.lps.properties">lps.properties file</xref>.
</para>
-<para>Also note that source code to your applications may be made visible through the context ("right click") menu. See <ulink url="../guide/input-devices.html#view_source" type="laszlo-dguide">this page</ulink> for a discussion about how to disable this programmatically.
+<para>Also note that source code to your applications may be made visible through the context ("right click") menu. See <xref linkend="input-devices"/> for a discussion about how to disable this programmatically.
</para>
<?ignore <h2>Deployment Checklist</h2>
Modified: openlaszlo/branches/devildog/docs/src/developers/animation.dbk
===================================================================
--- openlaszlo/branches/devildog/docs/src/developers/animation.dbk 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/developers/animation.dbk 2007-12-10 22:47:57 UTC (rev 7498)
@@ -125,7 +125,7 @@
examples back to their initial state. Use these examples to see how
different animation techniques compare to each other.</para>
-<para>These applications rely on the support file <ulink url="animation_library.lzx?lzt=source">animation_library.lzx</ulink>.</para>
+<para>These applications rely on the support file <ulink url="programs/animation_library.lzx?lzt=source">animation_library.lzx</ulink>.</para>
<para>The following example shows the effect of animating the
<indexterm><primary>opacity</primary></indexterm><sgmltag class="attribute">opacity</sgmltag>, <indexterm><primary>rotation</primary></indexterm><sgmltag class="attribute">rotation</sgmltag>,
Modified: openlaszlo/branches/devildog/docs/src/developers/css.dbk
===================================================================
--- openlaszlo/branches/devildog/docs/src/developers/css.dbk 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/developers/css.dbk 2007-12-10 22:47:57 UTC (rev 7498)
@@ -1,7 +1,7 @@
<chapter id="css">
-<title>CSS -- Cascading Style Sheets</title>
+<title>Cascading Style Sheets</title>
<!-- remove commented out sample code that was ignored by the build. IORIO 20 nov 2007 -->
<para>Cascading Style Sheets (CSS) enable web designers to enhance the power
of HTML tags. In old-fashioned HTML, an <H1> tag would make displayed
@@ -243,7 +243,7 @@
</programlisting>
</example>
-<para/></section></section><section><title>Importing an external stylesheet</title>
+<para/></section><section><title>Importing an external stylesheet</title>
<para>A stylesheet can be imported by using</para>
@@ -277,4 +277,4 @@
</programlisting></example>
-<para/></section></chapter>
+<para/></section></section></chapter>
Modified: openlaszlo/branches/devildog/docs/src/developers/programs/color-$7.lzx
===================================================================
--- openlaszlo/branches/devildog/docs/src/developers/programs/color-$7.lzx 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/developers/programs/color-$7.lzx 2007-12-10 22:47:57 UTC (rev 7498)
@@ -22,7 +22,8 @@
<text text="Storm"/>
</fader>
<script>
- Debug.write("Click on a view to reduce its opacity. Mouse out to restore 100% opacity.");
+ Debug.write("Click on a view to reduce its opacity.");
+ Debug.write("Mouse out to restore 100% opacity.");
</script>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
Modified: openlaszlo/branches/devildog/docs/src/developers/tutorials/programs/text-tutorial-$14.lzx
===================================================================
--- openlaszlo/branches/devildog/docs/src/developers/tutorials/programs/text-tutorial-$14.lzx 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/developers/tutorials/programs/text-tutorial-$14.lzx 2007-12-10 22:47:57 UTC (rev 7498)
@@ -11,7 +11,7 @@
Set Text
</button>
- <button x="180" y="115"
+ <button x="180" y="15"
onclick="addText();">
Add Text
</button>
Modified: openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/synopsis.xsl
===================================================================
--- openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/synopsis.xsl 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/synopsis.xsl 2007-12-10 22:47:57 UTC (rev 7498)
@@ -27,6 +27,7 @@
<xsl:import href="utilities.xsl"/>
<xsl:param name="visibility.filter" select="'public'"/>
+ <xsl:param name="warn.classname.not.found" select="0" />
<!-- SYNOPSIS -->
@@ -175,9 +176,11 @@
<!-- For instance methods, show the name of the class -->
<xsl:value-of select="ancestor::property/doc/tag[@name='lzxname']/text"/>.<xsl:value-of select="@name"/>
</xsl:when>
- <xsl:otherwise>
- <xsl:message>No class name found for function synopsis: <xsl:value-of select="@id"/></xsl:message>
- <xsl:value-of select="@name"/>
+ <xsl:otherwise>
+ <xsl:if test="$warn.classname.not.found">
+ <xsl:message>No class name found for function synopsis: <xsl:value-of select="@id"/></xsl:message>
+ </xsl:if>
+ <xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</methodname>
Modified: openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl
===================================================================
--- openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl 2007-12-10 22:47:57 UTC (rev 7498)
@@ -24,6 +24,9 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:param name="warn.unspecified.lzxtypes" select="0" />
+ <xsl:param name="warn.unspecified.jstypes" select="0" />
+
<xsl:key name="name-js" match="property" use="@name"/>
<xsl:key name="name-lzx" match="property" use="&tagname;"/>
@@ -58,6 +61,9 @@
</xsl:when>
<xsl:otherwise>
<xsl:text>?lzxtype?</xsl:text>
+ <xsl:if test="$warn.unspecified.lzxtypes">
+ <xsl:message>No lzxtype found for <xsl:value-of select="@name"/></xsl:message>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -76,8 +82,10 @@
</xsl:element>
</xsl:when>
<xsl:otherwise>
- <!-- We couldn't find a type for this. -->
- <xsl:message>No type found for <xsl:value-of select="@name"/></xsl:message>
+ <xsl:if test="$warn.unspecified.jstypes">
+ <!-- We couldn't find a type for this. -->
+ <xsl:message>No jstype found for <xsl:value-of select="@name"/></xsl:message>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Modified: openlaszlo/branches/devildog/docs/src/xsl/parameters.xsl
===================================================================
--- openlaszlo/branches/devildog/docs/src/xsl/parameters.xsl 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/docs/src/xsl/parameters.xsl 2007-12-10 22:47:57 UTC (rev 7498)
@@ -51,15 +51,15 @@
<xsl:param name="show.comments">1</xsl:param>
<!-- Reference appearance -->
- <xsl:param name="navig.showtitles">0</xsl:param>
- <xsl:param name="suppress.header.navigation">1</xsl:param>
- <xsl:param name="suppress.navigation">1</xsl:param>
+ <xsl:param name="navig.showtitles">1</xsl:param>
+ <xsl:param name="suppress.header.navigation">0</xsl:param>
+ <xsl:param name="suppress.navigation">0</xsl:param>
<xsl:param name="generate.toc">
set toc,title,index
- book toc,title,figure,table,example,equation,refentry
- part toc,title,figure,table,example,equation,refentry
+ book toc,title
+ part toc,title
chapter toc,title
preface toc,title
reference toc,title
Modified: openlaszlo/branches/devildog/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/devildog/lps/includes/source/embednew.js 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/lps/includes/source/embednew.js 2007-12-10 22:47:57 UTC (rev 7498)
@@ -56,7 +56,7 @@
var i = url.indexOf('lzr=swf');
if (i == -1) {
// add default version if missing
- url += '&lzr=swf7';
+ url += '&lzr=swf8';
i = url.indexOf('lzr=swf');
//alert('added version ' + url + ', ' + i);
}
Modified: openlaszlo/branches/devildog/test/typevar.lzx
===================================================================
--- openlaszlo/branches/devildog/test/typevar.lzx 2007-12-10 21:30:03 UTC (rev 7497)
+++ openlaszlo/branches/devildog/test/typevar.lzx 2007-12-10 22:47:57 UTC (rev 7498)
@@ -14,7 +14,7 @@
var v_init_const = 4;
var v_typed:int;
var v_typed_init:int = val * 2;
- var v_typed_q:?int = 123;
+ var v_typed_q:int? = 123;
var v_typed_ex:int! = 234;
// These must be set before use
More information about the Laszlo-checkins
mailing list