Author: ptw
Date: 2007-08-29 16:47:46 -0700 (Wed, 29 Aug 2007)
New Revision: 6284
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/UserClass.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapath.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapointer.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataset.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzBacktrace.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzMessage.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
Log:
Change 20070828-ptw-t by [EMAIL PROTECTED] on 2007-08-28 16:56:02 EDT
in /Users/ptw/OpenLaszlo/wafflecone-2
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Implement Debug.messageLevel, downgrade deprecated warnings
to info, heuristicate file/line info in Debug messages
Bugs Fixed:
LPP-4597 'turn debugger warnings for non-fatal issues into INFO'
LPP-4549 'runtime warnings should include file references, line #s' (partial)
LPP-4478 'Richedittext: WARNING: __LZgetNodes: p is null in LzDatapointer'
(partial)
LPP-4450 'improve LFC warnings for xpath query on empty datapath' (partial)
LPP-4551 'debugger warnings emitted from a private LFC function' (partial)
LPP-4592 'basedatacombobox-based components with selectfirst="false" emits
Debugger warnings' (partial)
LPP-4464 'setVisible(null) warning, but it is never called' (partial)
Technical Reviewer: max (Message-ID: <[EMAIL PROTECTED]>)
QA Reviewer: enw (pending)
Documentation:
In debug mode the compiler annotates every LzNode object with the
file/line where the object was created. If a node object is one
of the arguments to a Debug message, the debugger will use the
node object's file/line information when printing the message to
the console. [This is obviously not as accurate as we would like,
but it at least gives the programmer a hint as to where the
problem may lie.]
Debug.messageLevel is one of (from lowest to highest) 'ALL',
'DEBUG', 'INFO', 'WARNING', 'ERROR'; defaults to 'ALL'. Setting
it to a particular level will suppress all messages of a lower
level.
All deprecation messages have been changed from 'WARNING' to
'INFO'. By setting Debug.messageLevel to 'WARNING', deprecation
messages will be suppressed.
All API warnings that are new in 4.x have been changed from
'WARNING' to 'INFO'. By setting Debug.messageLevel to 'WARNING',
deprecation messages will be suppressed.
Details:
LzSprite, LzNode, LaszloView, LzAnimatorGroup, LzDatapointer,
LzDataset, LzDatapath, Class: Change all deprecated warnings to
use Debug.deprecated, or in custom cases Debug.info.
UserClass: Refine the warning that explains why <class name="xxx">
will not be defined as a global if there is already a global value
of the same name in the underlying runtime. Change the warning to
an info message.
LzMessage: Update frames to skip to match the current
implementation of backtrace. Heuristicate file/lineno from
message arguments. Add Debug.deprecated that handles common
deprecation messages.
LzDebug, kernel.as, kernel.js: Implement Debug.messageLevel.
LzBacktrace: Add a pretty type name.
NodeModel: Annotate nodes with their creation file and line.
Tests:
swf and dhtml smokecheck.
In smokecheck, the last two warnings now say:
WARNING: regression.lzl:730: serialize: p is null in LzDatapointer name: bad
WARNING: regression.lzl:744: setNodeAttribute: p is null in LzDatapointer
name: dp
Which indeed are the locations of the erroneous datapointers.
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/Class.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -188,7 +188,7 @@
Instance.make = function make () {
// Should not be called in the new world...
if ($debug) {
- Debug.warn("`%w.%s` is deprecated. Use `new %w` instead.", this,
arguments.callee, this);
+ Debug.info("`%w.%s` is deprecated. Use `new %w` instead.", this,
arguments.callee, this);
}
{
#pragma "passThrough=true"
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
===================================================================
---
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -308,10 +308,8 @@
*/
function start ( ){
if ( $debug ){
- Debug.warn( 'Animator start() is deprecated.' +
- 'Use animator doStart() instead.' );
+ Debug.deprecated(this, arguments.callee, this.doStart);
}
-
this.doStart();
}
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -929,7 +929,7 @@
*/
function setProp ( prop , val ){
if ( $debug ){
- Debug.warn( "setProp is deprecated. Use setAttribute instead." );
+ Debug.deprecated(this, arguments.callee, this.setAttribute);
}
this.setAttribute( prop , val );
}
@@ -1846,7 +1846,7 @@
*/
function deleteNode( recursiveCall ){
if ( $debug ){
- Debug.warn( "deleteNode is deprecated. Use destroy instead." );
+ Debug.deprecated(this, arguments.callee, this.destroy);
}
this.destroy( recursiveCall );
}
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/UserClass.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/UserClass.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/UserClass.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -143,8 +143,8 @@
// }
} else {
if ($debug) {
- Debug.warn('`%s` is already defined. Use `%s` instead.',
- classname, newclass);
+ Debug.info("The global `%s` is already defined. To dynamically create
a <%s> element, you will have to use `%s`.",
+ classname, classname, newclass);
}
}
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapath.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapath.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapath.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -459,8 +459,7 @@
*/
function retrieveData( ){
if ( $debug ){
- Debug.warn( "LzDatapath.retrieveData is deprecated."+
- "The new name for this method is 'updateData'");
+ Debug.deprecated(this, arguments.callee, this.updateData);
}
return this.updateData( );
}
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapointer.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDatapointer.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -193,8 +193,8 @@
function getXPath ( p ){
if ( $debug ){
if ( !this.didGetXPathWarn ){
- Debug.warn( "LzDatapointer.getXPath is deprecated." +
- "Use LzDatapointer.xpathQuery() or a $path{} instead."
);
+ Debug.info("%w.%s is deprecated. Use %w.%s or a $path{} constraint
instead.",
+ this, arguments.callee, this, this.xpathQuery);
}
this.didGetXPathWarn = true;
}
@@ -439,7 +439,7 @@
if ( n.childNodes.length ){
if ( this.ondata && !this.__LZoldOndataWarn ){
if ($debug) {
- Debug.warn( "Datapointer pointing to %w," +
+ Debug.info( "Datapointer pointing to %w," +
' relies on the ondata event from' +
" a datapointer bound to the root node of a dataset."+
" \n This behavior is deprecated." +
@@ -630,7 +630,7 @@
if ( p == null ){
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return false;
}
@@ -878,8 +878,8 @@
*/
function getNodeOffset (){
if ( $debug ) {
- Debug.warn( 'LzDatapointer.getNodeOffset is deprecated. ' +
- ' Use position() xpath instead' );
+ Debug.info("%w.%s is deprecated. Use XPath `position()` operator
instead.",
+ this, arguments.callee);
}
this.p.parentNode.__LZupdateCO();
return this.p.__LZo + 1;
@@ -892,7 +892,7 @@
function getNodeName (){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -906,7 +906,7 @@
function setNodeName (name){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -923,7 +923,7 @@
function getNodeAttributes (){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -938,7 +938,7 @@
function getNodeAttribute (name){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -954,7 +954,7 @@
function setNodeAttribute (name, val) {
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -968,7 +968,7 @@
function deleteNodeAttribute (name) {
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -985,7 +985,7 @@
function getNodeText (){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -1003,8 +1003,7 @@
function getOtherNodeText (n){
if ( $debug ) {
- Debug.warn( 'LzDatapointer.getOtherNodeText() is deprecated. ' +
- ' Use LzDatapointer.getNodeText() instead.' );
+ Debug.deprecated(this, arguments.callee, this.getNodeText);
}
var s = "";
if (n.c != null) {
@@ -1032,7 +1031,7 @@
function setNodeText (val) {
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -1075,7 +1074,7 @@
function addNode ( name, text , attrs ){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -1099,7 +1098,7 @@
function deleteNode ( ){
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -1154,7 +1153,7 @@
if ( ! dp.p ) return;
if ( ! this.p ) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -1178,7 +1177,7 @@
function __LZprocessOperator ( p , pp , depends ){
if (p == null) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
@@ -1268,7 +1267,7 @@
function serialize ( ){
if ( this.p == null) {
if ( $debug ) {
- Debug.warn("%s: p is null in %s", arguments.callee, this);
+ Debug.info("%s: p is null in %s", arguments.callee, this);
}
return;
}
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataset.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataset.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -346,8 +346,8 @@
*/
function getStatusCode (){
if ( $debug ){
- Debug.warn( 'LzDataset.getStatusCode is deprecated.' +
- ' Use onerror/ontimeout events instead.' );
+ Debug.info("%s.%w is deprecated. Use `onerror` and `ontimeout` events
instead.",
+ this, arguments.callee);
}
return 200;
}
@@ -516,8 +516,8 @@
*/
function getLoadTime( ) {
if ( $debug ){
- Debug.warn( 'LzDataset.getLoadTime() is deprecated.' +
- ' Look at dataRequest.loadtime object instead.' );
+ Debug.info("%w.%s is deprecated. Look at `%w.loadtime` object instead.",
+ this, arguments.callee, this.dataRequest);
}
}
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzBacktrace.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzBacktrace.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzBacktrace.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -73,6 +73,12 @@
}
/**
+ * Debug printer
+ * @access private
+ */
+__LzStackFrame.prototype._dbg_typename = "StackFrame";
+
+/**
* Snapshot of the current backtrace. Relies on compiler support that
* inserts code at the top of each function in debug mode that records
* the function's arguments in Debug.backtraceStack
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -47,6 +47,19 @@
Debug.printPretty = true;
/**
+ * Possible values of Debug.messageLevel (q.v.)
+ */
+Debug.messageLevels = {ALL: 0, DEBUG: 1, INFO: 2, WARNING: 3, ERROR: 4, NONE:
5};
+
+/**
+ * Debug messages are enabled/disabled by the
+ * setting of Debug.messageLevel. The valid levels are one of the
+ * keys of Debug.messageLevels. All messages of a lower level than
+ * the current setting will be suppressed
+ */
+Debug.messageLevel = 'ALL';
+
+/**
* Array of prefixes that indicate internal properties to the
* inspector. If Debug.showInternalProperties is false, any properties
* with a prefix in this set will not be displayed.
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzMessage.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzMessage.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzMessage.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -241,7 +241,7 @@
return this.toArray(function () {
return Debug.makeObjectLink.apply(Debug, arguments);
}).join('');
-}
+};
// Mimic built-in class, which hides all prototype methods
//ASSetPropFlags(LzMessage.prototype, null, 1);
@@ -258,11 +258,11 @@
var LzSourceMessage = function (file, line, message) {
switch (arguments.length) {
case 0:
- file = null;
+ file = null;
case 1:
- line = null;
+ line = null;
case 2:
- message = '';
+ message = '';
}
this.file = file;
this.line = line;
@@ -271,12 +271,24 @@
} else {
this.message = new LzMessage(message);
}
- // Append a backtrace if there is one -- skip 3 (warning, this, and
- // constructor frames)
- if (Debug['backtraceStack']) {
- if (Debug.backtraceStack.length > 3) {
- this.backtrace = Debug.backtrace(3);
+ // 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;
+ }
}
+ if (Debug.backtraceStack.length > skip) {
+ this.backtrace = Debug.backtrace(skip);
+ }
}
}
@@ -314,6 +326,16 @@
// Safari and Firefox do not implement arguments as an array
message = debug.formatToString.apply(debug,
Array.prototype.slice.call(arguments, 2));
}
+ // Heuristicate file/line from args
+ if (file == null) {
+ for (var i = 3; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (arg instanceof lz.node && '_dbg_filename' in arg) {
+ file = arg._dbg_filename;
+ line = arg._dbg_lineno;
+ }
+ }
+ }
return new this.prototype.constructor(file, line, message);
}
@@ -479,6 +501,17 @@
*/
Debug.debug = function (control, args) {
return this.warnInternal.apply(this,
[LzDebug].concat(Array.prototype.slice.call(arguments, 0)));
-}
+};
+/**
+ * Deprecation message
+ * @param lznode obj: The object the deprecated method is being called
+ * on (usually `this`).
+ * @param Function method: The method being called (usually
+ * arguments.callee)
+ * @param Function method: The replacement method
+ */
+Debug.deprecated = function (obj, method, replacement) {
+ Debug.info("%w.%s is deprecated. Use %w.%s instead", obj, method, obj,
replacement);
+}
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
===================================================================
---
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
2007-08-29 23:35:18 UTC (rev 6283)
+++
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
2007-08-29 23:47:46 UTC (rev 6284)
@@ -230,13 +230,18 @@
Debug.warnInternal = function (xtor, control, args) {
var sourceMessage = LzSourceMessage;
var level = sourceMessage.level
- if (level > sourceMessage.levelMax) { return; }
+ if (level > sourceMessage.levelMax) { return; }
try {
sourceMessage.level = level + 1;
// Safari and Firefox do not implement arguments as an array
var msg = xtor.format.apply(xtor, [null,
null].concat(Array.prototype.slice.call(arguments, 1)));
- this.freshLine();
- this.__write(msg);
+ {
+ var mls = this.messageLevels;
+ if (mls[xtor.prototype.type] >= mls[this.messageLevel]) {
+ this.freshLine();
+ this.__write(msg);
+ }
+ }
}
finally {
sourceMessage.level = level;
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
===================================================================
---
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
2007-08-29 23:35:18 UTC (rev 6283)
+++
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
2007-08-29 23:47:46 UTC (rev 6284)
@@ -116,8 +116,13 @@
sourceMessage.level = level + 1;
// Safari and Firefox do not implement arguments as an array
var msg = xtor.format.apply(xtor, [null,
null].concat(Array.prototype.slice.call(arguments, 1)));
- this.freshLine();
- this.__write(msg);
+ {
+ var mls = this.messageLevels;
+ if (mls[xtor.prototype.type] >= mls[this.messageLevel]) {
+ this.freshLine();
+ this.__write(msg);
+ }
+ }
// }
// finally {
sourceMessage.level = level;
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
2007-08-29 23:47:46 UTC (rev 6284)
@@ -1540,7 +1540,9 @@
this.__contextmenu = cmenu;
cmenu = cmenu.__LZcontextMenu();
} else {
- if ($debug) Debug.warn("Passing a Flash ContextMenu to
LzView.setContextMenu is deprecated, use LzContextMenu instead");
+ if ($debug) {
+ Debug.info("Passing a Flash ContextMenu to LzView.setContextMenu is
deprecated, use LzContextMenu instead");
+ }
}
var mc = this.getMCRef();
@@ -1555,7 +1557,7 @@
}
if (mb == null && mc == null) {
- if ($debug) Debug.warn("LzView.setContextMenu: cannot set menu on view
%w, it has no foreground or background movieclip");
+ if ($debug) Debug.warn("LzView.setContextMenu: cannot set menu on view
%w, it has no foreground or background movieclip", this.owner);
}
}
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs
2007-08-29 23:35:18 UTC (rev 6283)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs
2007-08-29 23:47:46 UTC (rev 6284)
@@ -858,7 +858,7 @@
/** @access private */
function searchimmediateparents ( prop ){
if ( $debug ){
- Debug.warn( "LzView.searchimmediateparents is deprecated. Use
LzNode.searchParents instead.");
+ Debug.deprecated(this, arguments.callee, this.searchParents);
}
return this.searchParents( prop );
@@ -1057,8 +1057,7 @@
/** @access private */
function deleteView( recursiveCall ){
if ( $debug ){
- Debug.warn( 'LzView.deleteView is deprecated.' +
- ' Use LzView.destroy instead' );
+ Debug.deprecated(this, arguments.callee, this.destroy);
}
this.destroy();
}
@@ -1084,7 +1083,9 @@
* This method sets the <attribute>visible</attribute> attribute of the view
* and also disables or re-enables any click region associated with the view.
*
- * @param Boolean amVisible: boolean for visibility of view
+ * @param Boolean|Null amVisible: Controls the visibility of a view.
+ * `true` makes the view visible, `false` makes the view hidden,
+ * `null` will make the view visible only if it has a data binding.
*/
function setVisible( amVisible ) {
if (this._visible == amVisible) return;
@@ -1094,15 +1095,16 @@
if (amVisible) {
var v = "visible";
} else if (amVisible == null) {
- var v = "collapse";
if ($debug) {
- //Debug.warn("setVisible(null) is deprecated, use
setVisibility('collapse') instead");
+ Debug.info("%w.%s(%w) is deprecated. Perhaps you meant %w.%s(%s)?
If not, use %w.%s('collapse').",
+ this, arguments.callee, amVisible, this,
arguments.callee, false, this, this.setVisibility);
}
+ var v = "collapse";
} else {
var v = "hidden";
}
this.visibility = v;
- //
+
if (this.onvisibility.ready) this.onvisibility.sendEvent( this.visibility
);
this.__LZupdateShown();
}
@@ -1125,7 +1127,8 @@
this.visibility = amVisible;
if ($debug) {
if (! (amVisible == "visible" || amVisible == "hidden" || amVisible ==
"collapse")) {
- Debug.warn("setVisibility called with unknown arg,", amVisible, "
use 'visible','hidden',or 'collapse'");
+ Debug.error("%w.%s called with unknown arg '%s' use 'visible',
'hidden', or 'collapse'.",
+ this, arguments.callee, amVisible);
}
}
if (this.onvisibility.ready) this.onvisibility.sendEvent( amVisible );
@@ -2396,8 +2399,8 @@
function getPlayPerc ( ){
if ( $debug ){
if ( !this.__LZdidPPwarn ){
- Debug.warn( 'LzView.getPlayPerc is deprecated. ' +
- 'Use frame/totalframes attributes instead.' );
+ Debug.info("%w.%s is deprecated. Use frame/totalframes attributes
instead.",
+ this, arguments.callee);
}
this.__LZdidPPwarn = true;
}
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
===================================================================
---
openlaszlo/branches/wafflecone/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
2007-08-29 23:35:18 UTC (rev 6283)
+++
openlaszlo/branches/wafflecone/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
2007-08-29 23:47:46 UTC (rev 6284)
@@ -483,6 +483,20 @@
attrs, events, references, paths, styles);
}
+ // Add file/line information if debugging
+ if (env.getBooleanProperty(env.DEBUG_PROPERTY)) {
+ // File/line stored separately for string sharing
+ String name = "_dbg_filename";
+ String filename = Parser.getSourceMessagePathname(element);
+ CompiledAttribute cattr =
+ compileAttribute(element, name, filename, ViewSchema.STRING_TYPE,
WHEN_IMMEDIATELY);
+ addAttribute(cattr, name, attrs, events, references, paths, styles);
+ name = "_dbg_lineno";
+ Integer lineno = Parser.getSourceLocation(element, Parser.LINENO);
+ cattr = compileAttribute(element, name, lineno.toString(),
ViewSchema.NUMBER_TYPE, WHEN_IMMEDIATELY);
+ addAttribute(cattr, name, attrs, events, references, paths, styles);
+ }
+
ClassModel classModel = getClassModel();
if (classModel == null) {
throw new CompilationError("Could not find class definition for tag
`" + className + "`", element);
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins