Author: ptw
Date: 2007-11-06 20:21:20 -0800 (Tue, 06 Nov 2007)
New Revision: 7177
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzContextMenu.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLoader.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMediaLoader.lzs
Log:
Change 20071106-ptw-G by [EMAIL PROTECTED] on 2007-11-06 11:50:28 EST
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Address Andre's comments on Change 20071102-ptw-t
Technical Reviewer: [EMAIL PROTECTED] (Message-ID: <[EMAIL PROTECTED]>)
QA Reviewer: [EMAIL PROTECTED] (pending)
Details:
LzMediaLoader, LzLoader, LzContextMenu: convert missed
DeclareEvent's.
Class: Don't modify plist args, style tweaks to make plist
iteration uniform.
Tests:
smokecheck
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs 2007-11-07 03:53:06 UTC
(rev 7176)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/compiler/Class.lzs 2007-11-07 04:21:20 UTC
(rev 7177)
@@ -334,16 +334,16 @@
}
// Create any trait interstitials, following the pattern above
if (traitsAndSuperclass instanceof Array) {
- while (traitsAndSuperclass.length) {
- var t = traitsAndSuperclass.pop();
- prototype = t.makeInterstitial(prototype, traitsAndSuperclass.length >
0);
+ for (var i = traitsAndSuperclass.length - 1; i >= 0; i--) {
+ var t = traitsAndSuperclass[i];
+ prototype = t.makeInterstitial(prototype, i > 0);
}
}
// Install the staticProperties
if (staticProperties) {
- while (staticProperties.length > 0) {
- var value = staticProperties.pop();
- var name = staticProperties.pop();
+ for (var i = staticProperties.length - 1; i >= 1; i -= 2) {
+ var value = staticProperties[i];
+ var name = staticProperties[i - 1];
nc.addStaticProperty(name, value);
}
}
@@ -357,9 +357,9 @@
}
// Class.initialize: Install initial values
if (instanceProperties) {
- while (instanceProperties.length > 0) {
- var value = instanceProperties.pop();
- var name = instanceProperties.pop();
+ for (var i = instanceProperties.length - 1; i >= 1; i -= 2) {
+ var value = instanceProperties[i];
+ var name = instanceProperties[i - 1];
nc.addProperty(name, value);
}
}
@@ -397,8 +397,7 @@
// Add to prototype
this.prototype[name] = value;
// Save for future implementations
- this.instanceProperties.push(name);
- this.instanceProperties.push(value);
+ this.instanceProperties.push(name, value);
// Add it to existing implementations
var impls = this.implementations;
for (var mash in impls) {
@@ -439,16 +438,15 @@
}
// Add the properties to the prototype (superclassInstance)
var ip = this.instanceProperties;
- var ipl = ip.length;
- for (var i = 0; i < ipl; i += 2) {
+ for (var i = ip.length - 1; i >= 1; i -= 2) {
+ var value = ip[i];
+ var name = ip[i - 1];
// if ($debug) {
// if (name in superclassInstance) {
// Debug.debug("%s.%s overrides %s.%s", this.classname, name,
// superclassInstance.constructor.classname, name);
// }
// }
- var name = ip[i];
- var value = ip[i+1];
superclassInstance.addProperty.call(superclassInstance, name, value);
}
// Make the interstitial
@@ -491,17 +489,17 @@
nt.addStaticProperty('makeInterstitial', this.makeInterstitial);
// Install the staticProperties
if (staticProperties) {
- while (staticProperties.length > 0) {
- var value = staticProperties.pop();
- var name = staticProperties.pop();
+ for (var i = staticProperties.length - 1; i >= 1; i -= 2) {
+ var value = staticProperties[i];
+ var name = staticProperties[i - 1];
nt.addStaticProperty(name, value);
}
}
// Trait.initialize: install initial values
if (instanceProperties) {
- while (instanceProperties.length > 0) {
- var value = instanceProperties.pop();
- var name = instanceProperties.pop();
+ for (var i = instanceProperties.length - 1; i >= 1; i -= 2) {
+ var value = instanceProperties[i];
+ var name = instanceProperties[i - 1];
nt.addProperty(name, value);
}
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzContextMenu.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzContextMenu.lzs
2007-11-07 03:53:06 UTC (rev 7176)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzContextMenu.lzs
2007-11-07 04:21:20 UTC (rev 7177)
@@ -27,8 +27,8 @@
this.setDelegate(del);
}
-DeclareEvent(prototype, 'onmenuopen' );
-DeclareEvent(prototype, 'onselect' );
+var onmenuopen = LzDeclaredEvent;
+var onselect = LzDeclaredEvent;
/**
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLoader.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLoader.lzs 2007-11-07
03:53:06 UTC (rev 7176)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLoader.lzs 2007-11-07
04:21:20 UTC (rev 7177)
@@ -75,10 +75,10 @@
}
-DeclareEvent(prototype, 'onerror' );
-DeclareEvent(prototype, 'ondata' );
-DeclareEvent(prototype, 'onrequest' );
-DeclareEvent(prototype, 'ontimeout' );
+var onerror = LzDeclaredEvent;
+var ondata = LzDeclaredEvent;
+var onrequest = LzDeclaredEvent;
+var ontimeout = LzDeclaredEvent;
var requestheaders = {};
var timeout = 30000;
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMediaLoader.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMediaLoader.lzs
2007-11-07 03:53:06 UTC (rev 7176)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMediaLoader.lzs
2007-11-07 04:21:20 UTC (rev 7177)
@@ -38,8 +38,8 @@
}
}
-DeclareEvent(prototype, 'onstreamstart' );
-DeclareEvent(prototype, 'onloaddone' );
+var onstreamstart = LzDeclaredEvent;
+var onloaddone = LzDeclaredEvent;
var LOADERDEPTH = 9;
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins