Author: ptw
Date: 2007-10-26 10:32:16 -0700 (Fri, 26 Oct 2007)
New Revision: 7020
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
Log:
Change 20071026-ptw-Y by [EMAIL PROTECTED] on 2007-10-26 08:01:02 EDT
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix order of array indices that was broken by r6857
Bugs Fixed:
LPP-4967 'Array indices out of order in Debugger'
Technical Reviewer: promanik (Message-Id: <[EMAIL PROTECTED]>)
QA Reviewer: max (pending)
Doc Reviewer: (pending)
Details:
Convert indices to numbers for sorting
Tests:
lzx> Debug.inspect([1,2,3,4,5,6,7,8,9,10,11,12])
?\194?\171Array(12)#0| [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]?\194?\187 {
0: 1
1: 2
2: 3
3: 4
4: 5
5: 6
6: 7
7: 8
8: 9
9: 10
10: 11
11: 12
}
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
lzx>
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs 2007-10-26
16:30:16 UTC (rev 7019)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzDebug.lzs 2007-10-26
17:32:16 UTC (rev 7020)
@@ -490,6 +490,9 @@
// that have a non-inherited value. This should find 'own' slots,
// getters, and funny 'native' slots like swf movieclips, etc.
if ((! proto) ||
+ // Be careful calling hasOwnProperty (it could be a method in
+ // a native prototype that will fail when called on the
+ // prototype itself)
this.ignoringErrors(function () { return obj.hasOwnProperty(key);},
this, (! (key in proto))) ||
// Be careful poking at prototypes (consider getters that may
// fail when called on the prototype)
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
2007-10-26 16:30:16 UTC (rev 7019)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
2007-10-26 17:32:16 UTC (rev 7020)
@@ -306,7 +306,11 @@
(thing.length >= 0)) ? [] : null;
this.objectOwnProperties(thing, names, indices, limit);
- if (indices) { indices.sort(); }
+ if (indices) { indices.sort(function (a, b) {
+ var al = Number(a);
+ var bl = Number(b);
+ return (al > bl) - (al < bl);
+ }); }
// No pretty for subclasses or non-objects or array-like objects
// that are not Arrays.
@@ -471,7 +475,11 @@
var bl = b.toLowerCase();
return (al > bl) - (al < bl);
});
- if (indices) { indices.sort(); }
+ if (indices) { indices.sort(function (a, b) {
+ var al = Number(a);
+ var bl = Number(b);
+ return (al > bl) - (al < bl);
+ }); }
var description = "";
var nnames = names.length;
var val;
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
2007-10-26 16:30:16 UTC (rev 7019)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
2007-10-26 17:32:16 UTC (rev 7020)
@@ -365,7 +365,11 @@
(thing.length >= 0)) ? [] : null;
this.objectOwnProperties(thing, names, indices, limit);
- if (indices) { indices.sort(); }
+ if (indices) { indices.sort(function (a, b) {
+ var al = Number(a);
+ var bl = Number(b);
+ return (al > bl) - (al < bl);
+ }); }
// No pretty for subclasses or non-objects or array-like objects
// that are not Arrays.
@@ -542,7 +546,11 @@
var bl = b.toLowerCase();
return (al > bl) - (al < bl);
});
- if (indices) { indices.sort(); }
+ if (indices) { indices.sort(function (a, b) {
+ var al = Number(a);
+ var bl = Number(b);
+ return (al > bl) - (al < bl);
+ }); }
var description = "";
var nnames = names.length;
var val;
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins