Author: hqm
Date: 2008-03-21 13:19:31 -0700 (Fri, 21 Mar 2008)
New Revision: 8343
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
Log:
Change 20080321-hqm-Z by [EMAIL PROTECTED] on 2008-03-21 16:15:14 EDT
in /Users/hqm/openlaszlo/devildog3/WEB-INF/lps/lfc
for http://svn.openlaszlo.org/openlaszlo/branches/devildog/WEB-INF/lps/lfc
Summary: merged swf8/swf9 Lznode
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
This version of LzNode.lzs has all the changes from the swf9 version
that should allow it to compile and run in swf9.
There is still a copy of LzNode.js for swf9 at the moment, because all
the swf9 stuff will be broken until all files are merged with swf8
versions. The swf9 .js versions will be deleted when everything is
using the .lzs versions.
Tests:
smokecheck swf8/dhtml
amazon swf8/dhtml
example/components/style_example
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
2008-03-21 18:58:01 UTC (rev 8342)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
2008-03-21 20:19:31 UTC (rev 8343)
@@ -40,6 +40,19 @@
static var tagname = 'node';
/** @access private */
static var attributes = new LzInheritedHash();
+
+ var __LZdeferDelegates:Boolean = false;
+ var _instanceAttrs:* = null;
+ var _instanceChildren:Array = null;
+ var __LZisnew:Boolean = false;
+ var __LZstyleConstraints:* = null;
+ // var syncNew:Boolean = null;
+ var __LZdeferredcarr:Array = null;
+ var _events:Array = null;
+ var data:* = null;
+ var classChildren:Array = null;
+ var __LZvizDat:Boolean = true;
+ var layouts:* = null; // Used by replication
/**
@@ -134,7 +147,7 @@
* @param Boolean instcall
* @access private
*/
-function LzNode ( parent , attrs , children , instcall ){
+function LzNode ( parent:* = null, attrs:* = null, children:* = null,
instcall:* = null){
this.__LZUID = "__U" + ++LzNode.__UIDs;
this.__LZdeferDelegates = true;
var qpos = LzDelegate.__LZdelegatesQueue.length;
@@ -269,7 +282,7 @@
*/
if (this.constructWithArgs) this.constructWithArgs( maskedargs );
- delete this.__LZdeferDelegates;
+ this.__LZdeferDelegates = null;
if (qpos != LzDelegate.__LZdelegatesQueue.length) {
// Drain the events queue back to where we started
LzDelegate.__LZdrainDelegatesQueue(qpos);
@@ -292,7 +305,7 @@
// Set _profile_instantiator_name to constructor._dbg_name for
// annotation in LzInstantiator.makeSomeViews
else {
- this._profile_instantiator_name = this.constructor._dbg_name;
+ this._profile_instantiator_name =
this['constructor']._dbg_name;
}
}
}
@@ -770,7 +783,7 @@
*/
function __LZclearPreventInit ( ){
var lzp = this.__LZpreventSubInit;
- delete this.__LZpreventSubInit;
+ this.__LZpreventSubInit = null;
var l = lzp.length;
for ( var i = 0; i < l; i++ ){
lzp[ i ].__LZcallInit();
@@ -781,7 +794,7 @@
* @access private
* @devnote LzCanvas replaces this method, so must be kept in sync
*/
-function __LZcallInit ( ){
+function __LZcallInit (an:* = null ){
if ( this.parent && this.parent.__LZpreventSubInit ){
this.parent.__LZpreventSubInit.push( this );
return;
@@ -883,7 +896,7 @@
* Applies a dictionary of args
* @access private
*/
-function __LZapplyArgs ( args , constcall ){
+function __LZapplyArgs ( args , constcall = null ){
var oset = {};
var hasset = null;
var hasearly = null;
@@ -1029,7 +1042,7 @@
* @devnote Note: this is inlined by the script compiler, so that
* must be updated if you change this function
*/
-function setAttribute(prop, val, ifchanged) {
+function setAttribute(prop, val, ifchanged = null) {
if (this.__LZdeleted || (ifchanged && (this[prop] == val))) return;
// Must agree with NodeModel in tag compiler
@@ -1162,8 +1175,16 @@
var x = ConstructorMap[ e.name ];
// TODO: [2005-03-24 ptw] Remove this if we ever enable
// warnings in the LFC as this will be redundant
- if ($debug) {
- if ((! x) || (! (x instanceof Function))) { Debug.error('Class for tag
%s has not been defined yet', e.name); }
+ if ($swf9) {
+ // TODO [hqm 2008-01] enable this warning unconditionally for now for swf9
debugging
+ // if ($debug) {
+ if ((! x) || (! (x is Class))) {
+ Debug.error('Class for tag ', e.name, ' has not been defined yet',
x);
+ }
+ } else {
+ if ($debug) {
+ if ((! x) || (! (x instanceof Function))) { Debug.error('Class for
tag %s has not been defined yet', e.name); }
+ }
}
// TODO: [2005-04-20 ptw] Don't know what this means, preserved
// for posterity:
@@ -1722,6 +1743,8 @@
// Ensure you have your own private options dictionary, not the one
// inherited from your class, nor the default empty one inherited
// from LzNode!
+
+ // TODO [hqm 2008-03] Will this work in swf9????
if (this.options === this['constructor'].prototype.options) {
this.options = new LzInheritedHash(this.options);
}
@@ -1828,6 +1851,15 @@
var sview = this;
do{
sview = sview.immediateparent;
+
+ if ($debug) {
+ // TODO [hqm 2008-02] put this check in a $debug, when that is working
for swf9
+ if (sview == null) {
+ Debug.error('searchParents got null immediateparent', this);
+ return;
+ }
+ }
+
if (sview[ prop ] != null ){
return sview;
}
@@ -1872,7 +1904,7 @@
* Deletes the node and all the subnodes.
* @param Boolean recursiveCall: internal use only
*/
-function destroy( recursiveCall ){
+function destroy( recursiveCall = null){
if (this.__LZdeleted == true) {
return;
}
@@ -1886,7 +1918,12 @@
this.__LZdeleted = true;
//don't allow a call on this method if I'm deleted
- this.__LZinstantiationDone = null;
+ if ($swf9) {
+ // TODO [hqm 2008-03]
+ // flex compiler gives error if you assign a function to null, what do
we do here?
+ } else {
+ this.__LZinstantiationDone = null;
+ }
//remove this and all subnodes
if (this.subnodes != null) {
@@ -1943,7 +1980,7 @@
this.__LZdelegates[ i ].unregisterAll();
}
}
- delete this.__LZdelegates;
+ this.__LZdelegates = null;
//remove events
if (('_events' in this) && (this._events != null)) {
@@ -1951,7 +1988,7 @@
this._events[i].clearDelegates();
}
}
- delete this._events;
+ this._events = null;
if (this.immediateparent && this.immediateparent.subnodes) {
for( var i = this.immediateparent.subnodes.length - 1; i >= 0; i-- ){
@@ -1962,7 +1999,7 @@
}
}
- delete this.data;
+ this.data = null;
if ($profile) {
var nm = this['_profile_name'];
@@ -1976,7 +2013,7 @@
/**
* @access private
*/
-function deleteNode( recursiveCall ){
+function deleteNode( recursiveCall = null){
if ( $debug ){
Debug.deprecated(this, arguments.callee, this.destroy);
}
@@ -2006,7 +2043,7 @@
* @return LzAnimator: a reference to the animator that was added
*/
-function animate( prop, to, duration, isRelative, moreargs ) {
+function animate( prop, to, duration, isRelative = null, moreargs = null ) {
if ( duration == 0 ){
var val = isRelative ? this[ prop ] + to : to;
@@ -2029,7 +2066,7 @@
* @access private
*/
function toString (){
- return this.constructor.classname + " " + this.getDebugIdentification();
+ return this['constructor'].classname + " " +
this.getDebugIdentification();
}
/**
@@ -2055,6 +2092,8 @@
return '.' + this.name;
} else {
// Don't use LzNode.toString, which is lame
+
+ // TODO [hqm 2008-03] Does asking for LzNode.prototype.toString work in
swf9?
if (this.toString !== LzNode.prototype.toString) {
return String(this);
} else {
@@ -2105,6 +2144,16 @@
}
}
+if ($swf9) { // TODO [hqm 2008-03] This is just a debugging print utility
function for swf9
+public static function objAsString(obj) {
+ var s = "";
+ for (var k in obj) {
+ s+= k +": "+obj[k];
+ s+=", ";
+ }
+ return s;
+ }
+}
/**
* @access private
* setter for $datapath
@@ -2119,3 +2168,7 @@
}
} // End of LzNode
+
+if ($swf9) {
+ConstructorMap[LzNode.tagname] = LzNode;
+}
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins