[Laszlo-checkins] r8174 - in openlaszlo/branches/devildog: . WEB-INF/lps/lfc/core WEB-INF/lps/lfc/data WEB-INF/lps/lfc/kernel/swf WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser WEB-INF/lps/server/src/org/openlaszlo/js2doc WEB-INF/lps/server/src/org/openlaszlo/sc docs/src docs/src/xsl docs/src/xsl/js2doc2dbk lps/components/base lps/components/extensions lps/components/extensions/test lps/components/lz lps/includes lps/includes/source test
dda@openlaszlo.org
dda at openlaszlo.org
Wed Mar 5 08:35:45 PST 2008
Author: dda
Date: 2008-03-05 08:35:27 -0800 (Wed, 05 Mar 2008)
New Revision: 8174
Added:
openlaszlo/branches/devildog/test/optarg.lzx
Removed:
openlaszlo/branches/devildog/lps/includes/blank.html
Modified:
openlaszlo/branches/devildog/
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSoundMC.as
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTLiteral.java
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTOperator.java
openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/SimpleNode.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/PropertyReference.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/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ReferenceCollector.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/VariableAnalyzer.java
openlaszlo/branches/devildog/docs/src/build.xml
openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk.xsl
openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl
openlaszlo/branches/devildog/docs/src/xsl/lzx2js2doc.xsl
openlaszlo/branches/devildog/lps/components/base/basetree.lzx
openlaszlo/branches/devildog/lps/components/extensions/html.lzx
openlaszlo/branches/devildog/lps/components/extensions/test/html.lzx
openlaszlo/branches/devildog/lps/components/lz/tree.lzx
openlaszlo/branches/devildog/lps/includes/source/embednew.js
openlaszlo/branches/devildog/lps/includes/source/iframemanager.js
openlaszlo/branches/devildog/lps/includes/source/lzhistory.js
Log:
Merged revisions 8108-8173 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
.......
r8113 | lou | 2008-02-27 09:34:33 -0500 (Wed, 27 Feb 2008) | 23 lines
Change 20080227-lou-m by lou at loumac.local on 2008-02-27 10:27:54 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Document that basetree needs a relative, not absolute datapath
Bugs Fixed: LPP-4603
Technical Reviewer: henry
QA Reviewer: (pending)
Doc Reviewer: (pending)
Details:
This was already documented in the reference page for <tree>, but the
markup was wrong, so the example code did not show up. Also, the
code was wrong (the nested <tree> was missing the /).
Fixed markup and example, and duplicated doc in the <basetree> page,
which is what the bug was reported against.
Tests: visual verify
.......
r8118 | dda | 2008-02-27 17:07:56 -0500 (Wed, 27 Feb 2008) | 65 lines
Change 20080222-dda-o by dda at lester.local on 2008-02-22 21:31:39 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-dep
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add support for new dependency mechanism in script compiler
New Features:
Bugs Fixed: LPP-5335 (partial)
Technical Reviewer: ptw (pending)
QA Reviewer: hminsky (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Introduces a new function Compiler.dependenciesForExpression() taking
a source expression e.g. "a.b.c + this.something.Fcn(1)" and
producing a source expression representing the dependency, e.g.
[a.b, "c"].concat(this.something.hasOwnProperty("$lsc$Fcn_dependencies") ? (this.something cast Object).$lsc$Fcn_dependencies(this, this.something, 1) : [])
This change does not functionally change *anything*, but it provides
an API needed to switch over to having the tag compiler generate the
dependency functions.
The significant changes are in ReferenceCollector, which keeps two
implementations (old and new) for the moment. It doesn't make sense
to refactor them into a common codebase since the old implementation
will go away after new dependencies are fully integrated. The old implementation
internal methods can be found in ReferenceCollector named as *_using_subfunction
in reference to the original naming convention fcn() -> fcn.dependencies() .
The new implementation uses naming fcn() -> $lsc$fcn_dependencies() as
indicated in the example above.
The implementation is conscious of the naming convention, since there
may be calls to the dependency functions in the produced output.
There is also a fix to the ParseTreePrinter so that it knows how to print
'cast'. This wasn't needed before to print final output from JS1, since
casts were always removed. Casts are generated in the dependency source
so they will work with SWF9 - without it, the flex compile complains
about references to nonexistant dependency functions. Downcasting to
Object makes the compiler *less* strict and accepting of any function name.
The output from the simple dependency given above has been tested to
compile with flex2 as a proof of concept.
Also a small improvement to ReferenceGenerator to only create one Compiler.Parser object.
This snippet added to NodeModel.java during testing (but not part of this change)
shows how the new dependency function can be called:
if (when.equals(WHEN_ALWAYS)) {
System.out.println("CONSTRAINT: src = " + canonicalValue.toString());
String dep = (new org.openlaszlo.sc.Compiler()).dependenciesForExpression(canonicalValue.toString());
System.out.println("CONSTRAINT: dep = " + dep);
}
Tests:
regression: smokecheck,weather,lzpix (swf8/dhtml), runlzunit
.......
r8124 | hqm | 2008-02-28 07:16:27 -0500 (Thu, 28 Feb 2008) | 30 lines
Change 20080228-hqm-Q by hqm at badtzmaru.local on 2008-02-28 07:15:34 EST
in /Users/hqm/openlaszlo/trunk/WEB-INF/lps/lfc
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc
Summary: fix for sourcelocators table
New Features:
Bugs Fixed:
Technical Reviewer: pbr
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The sourceLocatorTable declaration was mistranslated when the code
was turned into JS2 classes, it should have
been a static class var.
Tests:
SOLO DHTML deploy works with compiler flag of sourcelocators=true
.......
r8125 | hqm | 2008-02-28 08:41:54 -0500 (Thu, 28 Feb 2008) | 31 lines
Change 20080228-hqm-s by hqm at badtzmaru.local on 2008-02-28 08:40:54 EST
in /Users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix for LPP-5368, trying again
New Features:
Bugs Fixed:
Technical Reviewer: andre (pending)
QA Reviewer: mkratt
Doc Reviewer:
Documentation:
Release Notes:
Details:
For SOLO POST requests, when post body is empty, force a value
(__lzbc__ timestamp) into the post body.
Tests:
see test2.zip, attached to bug report; make sure to runs test as a
SOLO app (lzproxied=false)
.......
r8126 | ptw | 2008-02-28 08:57:33 -0500 (Thu, 28 Feb 2008) | 19 lines
Change 20080227-ptw-m by ptw at dueling-banjos.local on 2008-02-27 15:45:42 EST
in /Users/ptw/OpenLaszlo/ringding
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Send ondestroy _before_ marking node as deleted, so it gets
through.
New Features:
Bugs Fixed:
LPP-5462 'ondestroy event not fired in view'
Technical Reviewer: a.bargull at intensis.de (Message-ID: <47C5E205.5040202 at intensis.de>)
QA Reviewer: f.masini at studiopleiadi.it (pending)
Tests:
Test case in bug report
.......
r8128 | dda | 2008-02-28 14:14:49 -0500 (Thu, 28 Feb 2008) | 30 lines
Change 20080228-dda-C by dda at lester.local on 2008-02-28 14:03:03 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Doc: remove 'Known Direct Subclasses' section from new docs
New Features:
Bugs Fixed: LPP-5376
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: lou (pending)
Documentation:
Release Notes:
Details:
Code that generates Known Direct Subclasses has been commented out,
with a TODO left in. The generated docs will not have the paragraph
at all. This matches the docs in 3.4, and effectively defers various
issues with this section.
Tests:
generated doc and checked output for several pages (e.g. LzView
and LzText) that had this heading and verified it is gone.
Also grepped generated output directory.
.......
r8129 | max | 2008-02-28 14:30:35 -0500 (Thu, 28 Feb 2008) | 24 lines
Change 20080220-maxcarlson-O by maxcarlson at Roboto.local on 2008-02-20 14:33:48 PST
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Send onerror event for failed streaming mp3 loads in swf`
New Features:
Bugs Fixed: LPP-5445 - SoundMC does not send onerror-event
Technical Reviewer: promanik`
QA Reviewer: a.bargull at intensis.de
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Send onerror event when load fails.
Tests: See LPP-5445
.......
r8130 | hqm | 2008-02-28 15:21:16 -0500 (Thu, 28 Feb 2008) | 25 lines
Change 20080228-hqm-h by hqm at badtzmaru.local on 2008-02-28 15:20:08 EST
in /Users/hqm/openlaszlo/trunk/lps/components
for http://svn.openlaszlo.org/openlaszlo/trunk/lps/components
Summary: add additional doc for basetree
New Features:
Bugs Fixed: LPP_4603
Technical Reviewer: liorio
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Add doc about screw case with absolute datapaths
Tests:
.......
r8133 | lou | 2008-02-29 11:45:16 -0500 (Fri, 29 Feb 2008) | 18 lines
Change 20080229-lou-a by lou at loumac.local on 2008-02-29 12:40:09 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Document that basetree needs a relative, not absolute datapath
Bugs Fixed: LPP-4603
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Details: This was inadvertently documented twice. Remove the duplicate documentation.
Tests: visual verify
.......
r8136 | dda | 2008-02-29 13:45:20 -0500 (Fri, 29 Feb 2008) | 50 lines
Change 20080226-dda-5 by dda at lester.local on 2008-02-26 09:02:58 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Support optional and variable arg syntax for SWF8, DHTML
New Features: JS2 syntax for optional arguments and ...rest syntax for variable arguments now supported
Bugs Fixed: LPP-5273
Technical Reviewer: ptw (pending)
QA Reviewer: promanik (pending)
Doc Reviewer: (pending)
Documentation: The syntax allowed is according to the Ecmascript 4 draft standard,
which is implemented in ActionScript 3.
Release Notes:
Details:
The grammar aspect of this change is backported from the devildog branch.
To help future merges, it seemed best to take all grammar changes except for
the SWF9 'passthrough' work. Which means we get:
- varargs and optional args, with corresponding changes to ASTIdentifier
- recognition 'const' keyword (treating the same as 'var')
- 'catch' allows a type declaration for argument.
- turn on 'visitor' support in parser, could help with future work.
The changes to the formal arguments are made just before a function is translated,
and are designed as a single method. This will allow SWF9 to provide a
no-op for the method and keep its behavior to pass through the syntax
to the third party compiler.
The new function is formalArgumentsTransformations and is expected to be self documenting.
A small fix to 'setRuntime' in JavascriptGenerator spotted and changed.
Some unneeded code removed from CodeGenerator (this change already in devildog).
A new file test/optarg.lzx is added. This will supercede test/optargs.lzx already
in the devildog branch.
Tests:
(smokecheck,weather,lzpix) x (swf8,dhtml)
new test/optarg.lzx (swf8,dhtml)
one-off test: locally, incorporated parts of test/optarg.lzx into LFC to make
sure syntaxes work within 'class { function foo(args...) }'
syntax.
.......
r8140 | dda | 2008-02-29 16:03:00 -0500 (Fri, 29 Feb 2008) | 38 lines
Change 20080229-dda-y by dda at lester.local on 2008-02-29 13:57:49 EST
in /Users/clients/laszlo/src/svn/openlaszlo/trunk-doc2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Doc: Set type defaults for attributes to 'expression'.
New Features:
Bugs Fixed: LPP-5528
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: lou (pending)
Documentation:
Release Notes:
Details:
Note that a full ant build of doc may be required to see changes
(I was not seeing changes until I did that).
Any attributes of classes defined in lzx with no type information are
now set to Tag type: expression JS type: any
'expression' simply means that a type was not selected. Typically,
this means that a type could have, and should be indicated. For example,
hbox.inset has no type, but it's initial value is 0, and if I were to say
hbox.inset = 'hello', I would get strange results. So really, its
type should be indicated in the lzx file as 'Number'. This change, then,
provides compatibility for dealing with missing information, but
there is still the underlying issue that the info is missing.
Tests:
cd docs/src; ant clean; ant
look at output, for example, hbox.
.......
r8142 | dda | 2008-02-29 17:28:22 -0500 (Fri, 29 Feb 2008) | 30 lines
Change 20080229-dda-U by dda at lester.local on 2008-02-29 17:22:57 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Doc: fix build of 'developers' in clean tree.
New Features:
Bugs Fixed: LPP-5348
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: liorio (pending)
Documentation:
Release Notes:
Details:
Before this fix, you get an error if you (cd <TOP>; ant clean; cd docs/src; ant developers),
since js2doc.rng needs to be built as a first step.
Tests:
cd <TOP>
ant clean
cd docs/src
ant developers
(build now completes...)
.......
r8144 | max | 2008-02-29 21:28:06 -0500 (Fri, 29 Feb 2008) | 26 lines
Change 20080229-maxcarlson-Y by maxcarlson at Roboto on 2008-02-29 11:45:38 PST
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix html tag for wmode window in IE
New Features:
Bugs Fixed: LPP-5482 - Issue running swf in wmode "window" when using html tag
Technical Reviewer: promanik
QA Reviewer: lhenrywilkins at laszlosystems.com
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: embednew.js - Add Lz[appname]._getSWFDiv() API for use by iframemanager.
iframemanager.js - Track __topiframe. Call __refresh() when Flash gets the focus, to ensure the iframe remains visible.
Tests: See LPP-5482.
.......
r8145 | max | 2008-02-29 21:32:24 -0500 (Fri, 29 Feb 2008) | 27 lines
Change 20080229-maxcarlson-c by maxcarlson at Roboto on 2008-02-29 12:04:27 PST
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add API to enable/disable history for the html tag
New Features:
Bugs Fixed: LPP-5530 - The history mechanism is incompatible with the html tag
Technical Reviewer: promanik
QA Reviewer: lhenrywilkins at laszlosystems.com
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: extensions/test/html.lzx - Add history attribute example.
extensions/html.lzx - Add history attribute to html tag. If true, iframe chagnes will be added to the browser history. If false, iframe reloads are not added.
iframemanager.js - Set frame name based on id if not specified. Store frame names for lookup for in setSrc().
Tests: Change the history attribute in extensions/test/html.lzx to false and notice that reloading addresses doesn't add browser history entries.
.......
r8146 | max | 2008-02-29 21:35:20 -0500 (Fri, 29 Feb 2008) | 33 lines
Change 20080229-maxcarlson-S by maxcarlson at Roboto on 2008-02-29 15:42:21 PST
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix html frame support with SSL.
New Features:
Bugs Fixed: LPP-5532: Iframe in iframemanager.js causes unsecure items warning in IE with SSL turned on
Technical Reviewer: promanik
QA Reviewer: lhenrywilkins at laszlosystems.com
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Sending on behalf of Lorien with blank.html deleted from svn, and a minor typo fixed.
Need to initialize iframes that are used in the history mechanism and html tag to a value that will not be flagged as an unsecure item when the app is running with SSL. When no initial source value is set on an iframe it defaults to about:blank, which in IE resolves to http://about:blank even if the container page protocol is https.
Setting the initial source to javascript:"" solves the problem.
This change adds this initialization to the iframemanager, and changes the mechanism used in lzhistory
to be the one described above as it is a simpler solution. Previously in lzhistory.js the iframe source
was initialized to blank.html, which required a page called blank.html be available when the script
executes.
Tests: This can be tested by running the test case at lps/components/extensions/test/html-swf.jsp through
SSL in IE 6.0. Before this fix in in place you will get an unsecure content warning when the page loads.
.......
r8171 | dda | 2008-03-05 09:32:46 -0500 (Wed, 05 Mar 2008) | 35 lines
Change 20080304-dda-Q by dda at lester.local on 2008-03-04 10:32:20 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: In dependency calculation function, use bracket syntax rather than cast
New Features:
Bugs Fixed: LPP-5335
Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Previously, the new Compiler.dependenciesForExpression would
produce an expression like:
obj.hasOwnProperty("$lsc$Fcn_dependencies") ? (obj cast Object).$lsc$Fcn_dependencies(this, obj, arg1)
For consistency with other cases that must do 'typeless' references, this has been changed
to use the bracket notation:
obj.hasOwnProperty("$lsc$Fcn_dependencies") ? obj['$lsc$Fcn_dependencies'](this, obj, arg1)
Tests:
Checked regressions: (smokecheck, weather, lzpix) x (swf8, dhtml)
The feature itself cannot be easily checked until this function is used
within the new constraint framework.
.......
r8173 | dda | 2008-03-05 10:27:47 -0500 (Wed, 05 Mar 2008) | 34 lines
Change 20080305-dda-u by dda at lester.local on 2008-03-05 10:20:16 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: j2doc must process ASTFormalInitializer
New Features:
Bugs Fixed: LPP-5538
Technical Reviewer: (pending)
QA Reviewer: mamye (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Parser is now generating ASTFormalInitializer for any formal
function parameter that is initialized using the new 'optional
arguments' feature. Since this feature is now being used in LFC
files in devildog the error has been seen there first, in the nightly build.
This fix has been verified to build doc in devildog.
It is fixed in trunk because the new language feature is also
in trunk, and will start to be used there as well.
Tests:
With this change in devildog, did 'ant build doc' on a clean tree
without errors. Without the change, observed the same errors
seen by Mamye on devildog.
.......
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-8107
+ /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497 /openlaszlo/trunk:1-8173
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs 2008-03-05 16:35:27 UTC (rev 8174)
@@ -477,7 +477,7 @@
/** The source locator table maps source locations to nodes
* @access private
*/
- var sourceLocatorTable = {};
+ static var sourceLocatorTable = {};
/**
* Translate a source locator to the corresponding node
@@ -486,7 +486,7 @@
* the source locator is unknown
*/
function lookupSourceLocator (sourceLocator) {
- return this.sourceLocatorTable[sourceLocator];
+ return LzNode.sourceLocatorTable[sourceLocator];
}
}
@@ -1819,11 +1819,15 @@
if (this.__LZdeleted == true) {
return;
}
+
+ // Must be sent _before_ we mark ourself as deleted, or no
+ // delegates will be executed. This is our last and final act
+ // before we actually will be destroyed.
+ if (this.ondestroy.ready) this.ondestroy.sendEvent( this );
+
// To keep delegates from resurrecting us. See LzDelegate#execute
this.__LZdeleted = true;
- if (this.ondestroy.ready) this.ondestroy.sendEvent( this );
-
//don't allow a call on this method if I'm deleted
this.__LZinstantiationDone = null;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs 2008-03-05 16:35:27 UTC (rev 8174)
@@ -144,17 +144,17 @@
sep = '&';
}
- // [LPP-5368] If this is a SOLO POST request, put the
- // 'cache-breaking' arg into this post body. This prevents
- // the case of an empty POST body, which would cause the
- // Flash player to turn it into a GET request.
- if (!proxied && (dreq.method == "POST") && !dreq.clientcacheable) {
- q += cachebreak;
- }
-
postbody = q;
}
+ // [LPP-5368] If this is a SOLO POST request, with an empty
+ // POST body, put the 'cache-breaking' arg into this post
+ // body. This prevents the case of an empty POST body, which
+ // would cause the Flash player to turn it into a GET request.
+ if (!proxied && (dreq.method == "POST") && (postbody == null || postbody == '')) {
+ postbody = cachebreak;
+ }
+
var lzurl = new LzURL(dreq.src);
// For GET requests, merge in params data with URL query
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSoundMC.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSoundMC.as 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf/LzSoundMC.as 2008-03-05 16:35:27 UTC (rev 8174)
@@ -1,7 +1,7 @@
/**
* LzSoundMC.as
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @topic Kernel
@@ -156,6 +156,7 @@
*/
SoundMC.prototype.loadDone = function(success) {
if (success != true) {
+ this.loader.owner.owner.resourceloaderror();
if ($debug) {
Debug.warn("failed to load %w", this.reqobj.url);
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTLiteral.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTLiteral.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTLiteral.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -203,7 +203,7 @@
}
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -179,7 +179,7 @@
}
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTOperator.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTOperator.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTOperator.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/SimpleNode.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/SimpleNode.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/SimpleNode.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
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 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2006-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
@@ -253,7 +253,7 @@
if (parseNode instanceof ASTIdentifier) {
return ((ASTIdentifier) parseNode).getName();
} else if (parseNode instanceof ASTLiteral) {
- return ((ASTLiteral) parseNode).getValue().toString();
+ return String.valueOf(((ASTLiteral) parseNode).getValue());
} else
return "";
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/PropertyReference.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/PropertyReference.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/js2doc/PropertyReference.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
@@ -141,6 +141,9 @@
}
private static void addFunctionParameter(SimpleNode parseNode, org.w3c.dom.Element docNode) {
+ if (parseNode instanceof ASTFormalInitializer)
+ return;
+
org.w3c.dom.Element paramNode = docNode.getOwnerDocument().createElement("parameter");
docNode.appendChild(paramNode);
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 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -1722,6 +1722,8 @@
try {
options = options.copy();
context = new TranslationContext(ASTFunctionExpression.class, context, label);
+ node = formalArgumentsTransformations(node);
+ children = node.getChildren();
dependencies = translateFunctionInternal(node, useName, children);
}
finally {
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 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -432,6 +432,104 @@
return visitStatement(replNode);
}
+ /**
+ * If there are formal args that have initializers or indicate variable
+ * arguments, add a preamble to the function to perform any needed
+ * initialization to simulate the initialization.
+ * For example:
+ * <pre>
+ * function foo(w, x = null, y = null, ...z) {
+ * some statements
+ * }
+ * </pre>
+ * is rewritten as:
+ * <pre>
+ * function foo(w, x, y) {
+ * if (arguments.length < 2) { x = null; }
+ * if (arguments.length < 3) { y = null; }
+ * var z = new Array();
+ * for (__i=3; __i<arguments.length; __i++) {
+ * z.push(arguments[i]);
+ * }
+ * some statements
+ * }
+ * </pre>
+ * @param n function definition node
+ * @return modified function definition node
+ */
+ public SimpleNode formalArgumentsTransformations(SimpleNode n) {
+ // children are:
+ // (*) ASTIdentifier (name) (*) may be omitted
+ // ASTFormalParameterList
+ // ASTStatement (or statement list)
+ SimpleNode[] children = n.getChildren();
+ int formalPos = 0;
+ if (children.length > 0 && children[0] instanceof ASTIdentifier) {
+ formalPos++;
+ }
+ assert (children.length == formalPos+2 && children[formalPos] instanceof ASTFormalParameterList)
+ : "function has unexpected children";
+
+ SimpleNode[] args = children[formalPos].getChildren();
+ ASTIdentifier curid = null;
+ List stmts = new ArrayList();
+ List newargs = new ArrayList();
+
+ // The argument list is a list of ASTIdentifiers and ASTFormalInitializer.
+ // When a ASTFormalInitializer appears, it contains an initialization expression
+ // that applies to the previous argument. An ASTIdentifier can be marked
+ // with an ellipsis, the grammar should enforce it is the last one.
+ int argno = 0;
+ for (int i=0; i<args.length; i++) {
+ if (args[i] instanceof ASTIdentifier) {
+ curid = (ASTIdentifier)args[i];
+ if (curid.getEllipsis()) {
+ Map map = new HashMap();
+ String indexvar = "$lzsc$" + UUID().toString();
+ map.put("_1", new ASTIdentifier(curid.getName()));
+ map.put("_2", new ASTIdentifier(indexvar));
+ String pattern =
+ "var _1=new Array;" +
+ " for (var _2=" + argno + ";_2<arguments.length;_2++) {" +
+ "_1.push(arguments[_2]); }";
+ SimpleNode[] newNodes = (new Compiler.Parser()).substituteStmts(pattern, map);
+ stmts.addAll(flatten(newNodes));
+ }
+ else {
+ newargs.add(args[i]);
+ }
+ argno++;
+ }
+ else if (args[i] instanceof ASTFormalInitializer) {
+ assert curid != null : "ASTFormalInitializer appears first in list";
+ SimpleNode initialValue = args[i].get(0);
+ Map map = new HashMap();
+ map.put("_1", curid);
+ map.put("_2", initialValue);
+ String pattern = "if (arguments.length<" + argno + "){_1=(_2); }";
+ stmts.addAll(flatten((new Compiler.Parser()).substituteStmts(pattern, map)));
+ }
+ else {
+ throw new IllegalArgumentException("Unexpected item in argument list: " + args[i]);
+ }
+ }
+
+ // any alterations needed?
+ if (stmts.size() > 0) {
+ // newargs contains arguments without initializers
+ children[formalPos].setChildren((SimpleNode[])newargs.toArray(new SimpleNode[0]));
+
+ // Build a new statement list, consisting of new stmts for formal
+ // initializations, followed by original statements.
+ SimpleNode oldstmt = children[formalPos+1];
+ SimpleNode newstmt = new ASTStatementList(0);
+ newstmt.setChildren((SimpleNode[])stmts.toArray(new SimpleNode[0]));
+ newstmt.set(stmts.size(), oldstmt);
+ children[formalPos+1] = newstmt;
+ }
+ return n;
+ }
+
/*enum*/
public static class TranslateHow {
/** Runtime initialization of properties and methods */
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 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -391,6 +391,49 @@
}
}
+ /**
+ * @param source javascript source for a function (including function keyword, etc.)
+ * @param name name, will get name_dependencies as name of function
+ */
+ public String dependenciesForExpression(String estr) {
+ String fname = "$lsc$dependencies";
+ String source = "function " + fname + " () {" +
+ "\n#pragma 'constraintFunction'\n" +
+ "\n#pragma 'withThis'\n" +
+ // Use this.setAttribute so that the compiler
+ // will recognize it for inlining.
+ "this.setAttribute(\"x\", " +
+ "\n#beginAttribute\n" + estr +
+ "\n#endAttribute\n)}";
+
+ return dependenciesForFunction(source);
+ }
+
+ /**
+ * @param source javascript source for a function
+ */
+ private String dependenciesForFunction(String source) {
+ SimpleNode node = new Parser().parse(source);
+ // Expect ASTProgram -> ASTModifiedDefinition -> ASTFunctionDeclaration
+ SimpleNode fcn = node.get(0).get(0);
+ if (!(fcn instanceof ASTFunctionDeclaration))
+ throw new CompilerError("Internal error: bad AST for constraints");
+
+ ReferenceCollector dependencies = new ReferenceCollector(options.getBoolean(Compiler.COMPUTE_METAREFERENCES));
+
+ SimpleNode[] children = fcn.getChildren();
+ int stmtpos = (children.length - 1);
+ for (;stmtpos < children.length; stmtpos++) {
+ dependencies.visit(children[stmtpos]);
+ }
+ SimpleNode depExpr = dependencies.computeReferencesAsExpression();
+ String result = new ParseTreePrinter().text(depExpr);
+ if (options.getBoolean(Compiler.PRINT_CONSTRAINTS)) {
+ System.out.println(result);
+ }
+ return result;
+ }
+
//
// Compiler Options
//
@@ -723,6 +766,13 @@
return visit(node, keys);
}
+ // Input is one or more statements, returns the nodes
+ // that correspond to those statements
+ public SimpleNode[] substituteStmts(String str, Map keys) {
+ SimpleNode fexpr = substitute("(function () {" + str + "})()", keys);
+ return fexpr.get(0).get(1).getChildren();
+ }
+
public SimpleNode substituteStmt(String str, Map keys) {
SimpleNode node = parse("#file Compiler.substitute\n#line 0\n" + str).get(0);
return visit(node, keys);
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 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -22,7 +22,7 @@
public class JavascriptGenerator extends CommonGenerator implements Translator {
- protected void setRuntime(String runtiem) {
+ protected void setRuntime(String runtime) {
assert org.openlaszlo.compiler.Compiler.SCRIPT_RUNTIMES.contains(runtime) : "unknown runtime " + runtime;
}
@@ -1081,6 +1081,8 @@
try {
options = options.copy();
context = new TranslationContext(ASTFunctionExpression.class, context);
+ node = formalArgumentsTransformations(node);
+ children = node.getChildren();
result = translateFunctionInternal(node, useName, children);
}
finally {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -422,6 +422,7 @@
on.set(Ops.DELETE, "delete");
on.set(Ops.VOID, "void");
on.set(Ops.NEW, "new");
+ on.set(Ops.CAST, "cast");
OperatorNames = (String[])on.toArray(OperatorNames);
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ReferenceCollector.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ReferenceCollector.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ReferenceCollector.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -27,6 +27,7 @@
Set metareferences;
Set metafunctions;
String depth = "";
+ Compiler.Parser parser = new Compiler.Parser();
public ReferenceCollector() {
this(false);
@@ -64,9 +65,13 @@
return s;
}
+ // TODO: [2006-02-22 dda] Remove this 'subfunction' version soon.
+ // 'subfunction' naming (Class.f() and Class.f.dependencies())
+ // does not work in SWF9.
+
// f(args...) -> f["dependencies"](this, undefined, args...)
// a.f(args...) -> f["dependencies"](this, a, args...)
- private SimpleNode fsubst(SimpleNode node) {
+ private SimpleNode fsubst_using_subfunction(SimpleNode node) {
SimpleNode fn = node.get(0);
SimpleNode callee;
if (fn instanceof ASTPropertyIdentifierReference) {
@@ -84,12 +89,66 @@
map.put("_1", fn);
map.put("_2", callee);
map.put("_3", new Compiler.Splice(node.get(1).getChildren()));
- // TODO: [2006-01-03 ptw] Do we really need a new Parser each time?
- return (new Compiler.Parser()).substitute("_1.hasOwnProperty('dependencies') ? _1.dependencies(this, _2, _3) : []", map);
+ return parser.substitute("_1.hasOwnProperty('dependencies') ? _1.dependencies(this, _2, _3) : []", map);
}
+ // callee.fn(args...) ->
+ // ('$lsc$fn_dependencies' in callee) ?
+ // callee['$lsc$fn_dependencies'](args...) : []
+ // If callee doesn't exist (i.e. original expression is just fn()),
+ // then 'this' is assumed for callee. If we don't downcast the callee
+ // at the point of the call, on SWF9 we'd get compile errors
+ // when the dependency function doesn't exist.
+ // The cast is a no-op for runtimes that don't need them.
+ private SimpleNode fsubst(SimpleNode node) {
+ SimpleNode fn = node.get(0);
+ SimpleNode callee;
+ if (fn instanceof ASTPropertyIdentifierReference) {
+ callee = fn.get(0);
+ fn = fn.get(1);
+ } else {
+ callee = new ASTThisReference(0);
+ }
+ String depnm = "$lsc$" + ((ASTIdentifier)fn).getName() + "_dependencies";
+
+ // the function uses #pragma "warnUndefinedReferences=false"
+ // to avoid warnings for non-existent dependencies
+ Map map = new HashMap();
+ map.put("_1", callee);
+ map.put("_2", new Compiler.Splice(node.get(1).getChildren()));
+
+ return parser.substitute("('" + depnm + "' in _1) ? _1['" + depnm + "'](this, _1, _2) : []", map);
+ }
+
+ // TODO: [2006-02-22 dda] Remove this 'subfunction' version soon.
+ // 'subfunction' naming (Class.f() and Class.f.dependencies())
+ // does not work in SWF9.
+
// Concatenate references array with any results from dependeny
// functions
+ private SimpleNode build_using_subfunction(Set references, Set functions) {
+ SimpleNode a = rsubst(references);
+ Map map = new HashMap();
+ Set added = new HashSet();
+ ParseTreePrinter ptp = new ParseTreePrinter();
+ for (Iterator i = functions.iterator(); i.hasNext(); ) {
+ SimpleNode n = (SimpleNode)i.next();
+ String s = ptp.text(n);
+ // Eliminate redundant constraints
+ if (! added.contains(s)) {
+ added.add(s);
+ SimpleNode b = fsubst_using_subfunction(n);
+
+ map.put("_1", a);
+ map.put("_2", b);
+ a = parser.substitute("_1.concat(_2)", map);
+ }
+ }
+ return a;
+ }
+
+ // Concatenate references array with any results from dependeny
+ // functions
private SimpleNode build(Set references, Set functions) {
SimpleNode a = rsubst(references);
Map map = new HashMap();
@@ -105,17 +164,30 @@
map.put("_1", a);
map.put("_2", b);
- // TODO: [2006-01-03 ptw] Do we really need a new Parser each time?
- a = (new Compiler.Parser()).substitute("_1.concat(_2)", map);
+ a = parser.substitute("_1.concat(_2)", map);
}
}
return a;
}
+ // TODO: [2006-02-22 dda] Do we want to keep computeMetaReferences?
+ // ptw says it's a failed experiment. It's hard to test any
+ // new code that keeps it alive.
+
+ public SimpleNode computeReferencesAsExpression() {
+ return build(references, functions);
+ }
+
+ // TODO: [2006-02-22 dda] Remove this 'subfunction' version soon.
+ // 'subfunction' naming (Class.f() and Class.f.dependencies())
+ // does not work in SWF9.
+ // Migrate callers to new implementation in
+ // computeReferencesAsExpression().
+
public SimpleNode computeReferences(String name) {
// Sanitize the name
name = name.replace('#', '_').replace(' ', '_').replace('/', '_').replace('.', '_');
- SimpleNode d = build(references, functions);
+ SimpleNode d = build_using_subfunction(references, functions);
if (computeMetaReferences) {
for (Iterator i = metareferences.iterator(); i.hasNext(); ) {
SimpleNode r = (SimpleNode)i.next();
@@ -125,13 +197,12 @@
metareferences.remove(r);
}
}
- SimpleNode md = build(metareferences, metafunctions);
+ SimpleNode md = build_using_subfunction(metareferences, metafunctions);
// store metadependencies as a property of deps
Map map = new HashMap();
map.put("_1", d);
map.put("_2", md);
- // TODO: [2006-01-03 ptw] Do we really need a new Parser each time?
- return (new Compiler.Parser()).substitute(
+ return parser.substitute(
// TODO: [2003-06-19 ptw] (krank) Have to use sanitized
// name here, so that substitute does not try to name
// the function "x"
@@ -144,8 +215,7 @@
} else {
Map map = new HashMap();
map.put("_1", d);
- // TODO: [2006-01-03 ptw] Do we really need a new Parser each time?
- return (new Compiler.Parser()).substitute(
+ return parser.substitute(
// TODO: [2003-06-19 ptw] (krank) Have to use sanitized
// name here, so that substitute does not try to name
// the function "x"
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -126,6 +126,15 @@
return false;
}
+ // override superclass version - we do not want the
+ // generator to replace optional function parameters
+ // or variable arguments (e.g. function f(a1, a2=0, a3=0, ...rest)),
+ // we want to pass them right through to the backend compiler.
+ //
+ public SimpleNode formalArgumentsTransformations(SimpleNode n) {
+ return n;
+ }
+
public void setGeneratorOptions() {
options.putBoolean(Compiler.PASSTHROUGH_FORMAL_INITIALIZERS, true);
// Inhibit function names because swf9 JIT seems to choke on them
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/VariableAnalyzer.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/VariableAnalyzer.java 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/VariableAnalyzer.java 2008-03-05 16:35:27 UTC (rev 8174)
@@ -1,7 +1,7 @@
/* -*- mode: Java; c-basic-offset: 2; -*- */
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
Modified: openlaszlo/branches/devildog/docs/src/build.xml
===================================================================
--- openlaszlo/branches/devildog/docs/src/build.xml 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/docs/src/build.xml 2008-03-05 16:35:27 UTC (rev 8174)
@@ -394,8 +394,7 @@
<!-- JS2DOC-RELATED TARGETS -->
- <target name="js2doc.rng"
- unless="reference.skip">
+ <target name="js2doc.rng">
<ant dir="${lps.server.dir}" target="js2doc.rng" inheritAll="false"/>
</target>
@@ -1149,7 +1148,7 @@
<!-- developer's guide -->
- <target name="developers.preprocess" depends="init">
+ <target name="developers.preprocess" depends="init,js2doc.rng">
<copy todir="${developers.build.dir}">
<fileset dir="${developers.input.dir}"/>
</copy>
Modified: openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl
===================================================================
--- openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk/utilities.xsl 2008-03-05 16:35:27 UTC (rev 8174)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!DOCTYPE xsl:stylesheet [
@@ -97,7 +97,9 @@
<xsl:text>Object</xsl:text>
</xsl:when>
<xsl:when test="$lzxtype = 'expression'">
- <xsl:text>Object</xsl:text>
+ <!-- TODO [dda 2008-02-28] using 'Object' would be more correct,
+ but we are matching the 3.4 doc output for the moment -->
+ <xsl:text>any</xsl:text>
</xsl:when>
<xsl:when test="$lzxtype = 'boolean'">
<!-- Either 'boolean' or 'Boolean' might be correct. Putting this rule in to document that we're making a choice -->
@@ -206,4 +208,4 @@
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
Modified: openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk.xsl 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/docs/src/xsl/js2doc2dbk.xsl 2008-03-05 16:35:27 UTC (rev 8174)
@@ -378,11 +378,16 @@
</refsect1>
+ <!-- TODO [dda 2008-02-28] commented out 'known direct subclasses'.
+ It can produce broken links and sometimes is shown when there
+ none. This section was not shown in 3.4 docs.
+
<xsl:if test="$show.known.subclasses">
<refsect1>
<xsl:call-template name="describe-known-subclasses" />
</refsect1>
</xsl:if>
+ -->
</xsl:template>
Modified: openlaszlo/branches/devildog/docs/src/xsl/lzx2js2doc.xsl
===================================================================
--- openlaszlo/branches/devildog/docs/src/xsl/lzx2js2doc.xsl 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/docs/src/xsl/lzx2js2doc.xsl 2008-03-05 16:35:27 UTC (rev 8174)
@@ -232,9 +232,14 @@
<xsl:if test="@value">
<tag name="lzxdefault"><text><xsl:value-of select="@value"/></text></tag>
</xsl:if>
- <xsl:if test="@type">
- <tag name="lzxtype"><text><xsl:value-of select="@type"/></text></tag>
- </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@type">
+ <tag name="lzxtype"><text><xsl:value-of select="@type"/></text></tag>
+ </xsl:when>
+ <xsl:otherwise>
+ <tag name="lzxtype"><text>expression</text></tag>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:if test="doc">
<xsl:copy-of select="doc/*"/>
</xsl:if>
Modified: openlaszlo/branches/devildog/lps/components/base/basetree.lzx
===================================================================
--- openlaszlo/branches/devildog/lps/components/base/basetree.lzx 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/components/base/basetree.lzx 2008-03-05 16:35:27 UTC (rev 8174)
@@ -664,6 +664,37 @@
<img src="images/basetree/basetree-diagram.png"/>
+ <p>
+ When the <classname>basetree</classname> expands recursively, the datapath must be
+ a relative reference to the dataset. If an absolute
+ refrence is used, the same nodes would be selected over
+ and over forever, resulting in and endless loop.
+
+ For example, this will hang in an endless loop:
+
+ <programlisting>
+ <dataset name="navdata">
+ <navmenu>
+ <section />
+ </navmenu>
+ </dataset>
+
+
+ <view x="10" y="10" layout="axis: x; spacing: 10">
+ <basetree width="160" height="20" datapath="navdata:/navmenu" />
+ </view>
+ </programlisting>
+
+ It needs to be rewritten to have a relative datapath in the recursively expanding
+ tree node.
+
+ <programlisting>
+ <basetree width="160" height="20" datapath="navdata:/navmenu">
+ <basetree width="160" height="20" datapath="*" />
+ </basetree>
+ </programlisting>
+ </p>
+
<example title="Basetree subclass with echoed text node">
<canvas width="200" height="200">
<include href="base/basetree.lzx"/>
@@ -708,7 +739,7 @@
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/branches/devildog/lps/components/extensions/html.lzx
===================================================================
--- openlaszlo/branches/devildog/lps/components/extensions/html.lzx 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/components/extensions/html.lzx 2008-03-05 16:35:27 UTC (rev 8174)
@@ -1,5 +1,5 @@
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
@@ -22,8 +22,8 @@
,setPosition: function(id, x, y, width, height, v) {
LzBrowser.callJS('Lz.iframemanager.setPosition', false, id, x, y, width, height, v);
}
- ,setSrc: function(id, src) {
- LzBrowser.callJS('Lz.iframemanager.setSrc', null, id, src);
+ ,setSrc: function(id, src, history) {
+ LzBrowser.callJS('Lz.iframemanager.setSrc', null, id, src, history);
}
,setVisible: function(id, v) {
LzBrowser.callJS('Lz.iframemanager.setVisible', false, id, v);
@@ -49,8 +49,8 @@
<attribute name="heightoffset" type="number" value="0"/>
<attribute name="loading" type="boolean" value="false"/>
<attribute name="appendto" value="null"/>
- <attribute name="iframe" value="null"/>
<attribute name="ready" value="false"/>
+ <attribute name="history" value="true"/>
<attribute name="target" value="null" setter="this.setTarget(target)"/>
<attribute name="framename" value="" type="string"/>
@@ -86,7 +86,7 @@
this.src = s;
this.setAttribute('loading', true);
if (this['iframeid']) {
- Lz.iframemanager.setSrc(this.iframeid, s);
+ Lz.iframemanager.setSrc(this.iframeid, s, this.history);
} else {
this.srcset = s;
}
@@ -120,7 +120,7 @@
this.iframeid = id;
this.__updatepos();
if (this['isfront']) this.bringToFront();
- if (this['srcset']) Lz.iframemanager.setSrc(id, this.srcset);
+ if (this['srcset']) Lz.iframemanager.setSrc(id, this.srcset, this.history);
this.setAttribute('ready', true);
</method>
<method name="__gotload">
Modified: openlaszlo/branches/devildog/lps/components/extensions/test/html.lzx
===================================================================
--- openlaszlo/branches/devildog/lps/components/extensions/test/html.lzx 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/components/extensions/test/html.lzx 2008-03-05 16:35:27 UTC (rev 8174)
@@ -21,7 +21,7 @@
</handler>
</button>
<text name="status" y="3" fontstyle="bold" visible="${parent.main.loading}">Loading...</text>
- <html name="main" heightoffset="-74" widthoffset="-19" xoffset="7" yoffset="50">
+ <html name="main" heightoffset="-74" widthoffset="-19" xoffset="7" yoffset="50" history="true">
<handler name="oninit">
this.bringToFront();
</handler>
Modified: openlaszlo/branches/devildog/lps/components/lz/tree.lzx
===================================================================
--- openlaszlo/branches/devildog/lps/components/lz/tree.lzx 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/components/lz/tree.lzx 2008-03-05 16:35:27 UTC (rev 8174)
@@ -143,17 +143,37 @@
specified lexically or through data replication
<!--link-->.</p>
- <p>Note that a data replicated tree passes its XPath
- <!--link--> down to its subtrees, so avoid specifying an XPath
- such as "<code>mydataset:/*</code>" or your tree will infinite
- loop. Instead, do the following:</p>
+ <p>
+ When the <classname>tree</classname> expands recursively, the datapath must be
+ a relative reference to the dataset. If an absolute
+ refrence is used, the same nodes would be selected over
+ and over forever, resulting in and endless loop.
+
+ For example, this will hang in an endless loop:
+
+ <programlisting>
+ <dataset name="navdata">
+ <navmenu>
+ <section />
+ </navmenu>
+ </dataset>
+
+
+ <view x="10" y="10" layout="axis: x; spacing: 10">
+ <tree width="160" height="20" datapath="navdata:/navmenu" />
+ </view>
+ </programlisting>
+
+ It needs to be rewritten to have a relative datapath in the recursively expanding
+ tree node.
+
+ <programlisting>
+ <tree width="160" height="20" datapath="navdata:/navmenu">
+ <tree width="160" height="20" datapath="*" />
+ </tree>
+ </programlisting>
+ </p>
- <example class="program" executable="false" extract="false">
- <tree datapath="mydataset:/" showroot="false">
- <tree datapath="*">
- </tree>
- </example>
-
<p>Each resource, if specified, should have three states. The expander resource
should have an open (frame 1), closed (frame 2), and transparent (frame 3)
state. The icon resource should have similar frames. See the default resources
@@ -212,7 +232,7 @@
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Deleted: openlaszlo/branches/devildog/lps/includes/blank.html
Modified: openlaszlo/branches/devildog/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/devildog/lps/includes/source/embednew.js 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/includes/source/embednew.js 2008-03-05 16:35:27 UTC (rev 8174)
@@ -2,7 +2,7 @@
* @topic Browser
* @subtopic Integration
* @access public
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*/
@@ -113,6 +113,7 @@
,_ready: Lz._ready
// List of functions to call when the app is loaded
,_onload: []
+ ,_getSWFDiv: Lz._getSWFDiv
,loaded: false
,_sendMouseWheel: Lz._sendMouseWheel
,_setCanvasAttributeDequeue: Lz._setCanvasAttributeDequeue
@@ -595,6 +596,10 @@
return root;
}
,/** @access private */
+ _getSWFDiv: function() {
+ return dojo.flash.obj.get();
+ }
+ ,/** @access private */
_sendMouseWheel: function(d) {
if (d != null) this.callMethod("LzKeys.__mousewheelEvent(" + d + ")");
}
Modified: openlaszlo/branches/devildog/lps/includes/source/iframemanager.js
===================================================================
--- openlaszlo/branches/devildog/lps/includes/source/iframemanager.js 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/includes/source/iframemanager.js 2008-03-05 16:35:27 UTC (rev 8174)
@@ -1,10 +1,11 @@
/* X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************/
Lz.iframemanager = {
__highestz: 0
,__frames: {}
+ ,__namebyid: {}
,create: function(owner, name, appendto) {
//alert(owner + ', ' + name + ', ' + appendto)
var i = document.createElement('iframe');
@@ -14,9 +15,12 @@
var id = '__lz' + Lz.iframemanager.__highestz++;
Lz.iframemanager.__frames[id] = i;
- if (name == null) name = '';
+ if (name == null || name == 'null') name = id;
if (name != "") Lz.__setAttr(i, 'name', name);
+ this.__namebyid[id] = name;
+ Lz.__setAttr(iframe, 'src', 'javascript:""');
+
if (appendto == null || appendto == "undefined") {
appendto = document.body;
}
@@ -28,11 +32,21 @@
iframe.__gotload = Lz.iframemanager.__gotload;
iframe._defaultz = 99900 + Lz.iframemanager.__highestz;
iframe.style.zIndex = iframe._defaultz;
+
+ Lz.iframemanager.__topiframe = id;
if (document.getElementById && !(document.all) ) {
iframe.style.border = '0';
} else if (document.all) {
+ // IE
Lz.__setAttr(iframe, 'border', '0');
Lz.__setAttr(iframe, 'allowtransparency', 'true');
+
+ var metadata = Lz[iframe.owner]
+ if (metadata.runtime == 'swf') {
+ // register for onfocus event for swf movies - see LPP-5482
+ var div = metadata._getSWFDiv();
+ div.onfocus = Lz.iframemanager.__refresh;
+ }
}
iframe.style.position = 'absolute';
return id + '';
@@ -40,12 +54,20 @@
,getFrame: function(id) {
return Lz.iframemanager.__frames[id];
}
- ,setSrc: function(id, s) {
+ ,setSrc: function(id, s, history) {
//console.log('setSrc', id, s)
- var iframe = Lz.iframemanager.getFrame(id);
- if (! iframe) return;
- Lz.__setAttr(iframe, 'src', s);
- return true;
+ if (history) {
+ var iframe = Lz.iframemanager.getFrame(id);
+ if (! iframe) return;
+ Lz.__setAttr(iframe, 'src', s);
+ return true;
+ } else {
+ var id = Lz.iframemanager.__namebyid[id];
+ var iframe = window[id];
+ if (! iframe) return;
+ iframe.location.replace(s);
+ return true;
+ }
}
,setPosition: function(id, x, y, width, height, visible) {
//Debug.write('setPosition', id);
@@ -74,7 +96,6 @@
var iframe = Lz.iframemanager.getFrame(id);
if (! iframe) return;
iframe.style.display = v ? 'block' : 'none';
- this._visible = v;
return true;
}
,bringToFront: function(id) {
@@ -83,6 +104,7 @@
var iframe = Lz.iframemanager.getFrame(id);
if (! iframe) return;
iframe.style.zIndex = 100000 + Lz.iframemanager.__highestz;
+ Lz.iframemanager.__topiframe = id;
return true;
}
,sendToBack: function(id) {
@@ -110,4 +132,14 @@
Lz[iframe.owner].callMethod('Lz.iframemanager.__gotload(\'' + id + '\')');
}
}
+ ,__refresh: function() {
+ // called in IE for onfocus event in swf - see LPP-5482
+ if (Lz.iframemanager.__topiframe) {
+ var iframe = Lz.iframemanager.getFrame(Lz.iframemanager.__topiframe);
+ if (iframe.style.display == 'block') {
+ iframe.style.display = 'none';
+ iframe.style.display = 'block';
+ }
+ }
+ }
}
Modified: openlaszlo/branches/devildog/lps/includes/source/lzhistory.js
===================================================================
--- openlaszlo/branches/devildog/lps/includes/source/lzhistory.js 2008-03-05 15:27:47 UTC (rev 8173)
+++ openlaszlo/branches/devildog/lps/includes/source/lzhistory.js 2008-03-05 16:35:27 UTC (rev 8174)
@@ -44,7 +44,7 @@
Lz.__setAttr(i, 'scrolling', 'no');
Lz.__setAttr(i, 'width', '0');
Lz.__setAttr(i, 'height', '0');
- Lz.__setAttr(i, 'src', 'blank.html');
+ Lz.__setAttr(i, 'src', 'javascript:""');
document.body.appendChild(i);
i = document.getElementById('lzHistory');
_this._iframe = i;
Copied: openlaszlo/branches/devildog/test/optarg.lzx (from rev 8173, openlaszlo/trunk/test/optarg.lzx)
More information about the Laszlo-checkins
mailing list