You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/04/09 01:06:00 UTC

[41/47] git commit: [flex-asjs] [refs/heads/develop] - make trace handle multiple args

make trace handle multiple args


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f1164264
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f1164264
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f1164264

Branch: refs/heads/develop
Commit: f1164264f6092e806479df8b832a35692894db94
Parents: 61fc278
Author: Alex Harui <ah...@apache.org>
Authored: Wed Apr 8 12:12:58 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Apr 8 12:12:58 2015 -0700

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/utils/Language.js     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1164264/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
index 3fdb371..b890dac 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
@@ -155,12 +155,16 @@ org_apache_flex_utils_Language.is = function(leftOperand, rightOperand) {
  * trace()
  *
  * @expose
- * @param {string=} opt_value The message to be written to the console.
+ * @param {...Object} var_args The message(s) to be written to the console.
  */
-org_apache_flex_utils_Language.trace = function(opt_value) {
+org_apache_flex_utils_Language.trace = function(var_args) {
   var theConsole;
 
-  opt_value = (opt_value !== undefined) ? opt_value : '';
+  var msg = '';
+  for (var i = 0; i < arguments.length; i++) {
+    if (i > 0) msg += ' ';
+    msg += arguments[i];
+  }
 
   theConsole = goog.global.console;
 
@@ -169,7 +173,7 @@ org_apache_flex_utils_Language.trace = function(opt_value) {
 
   try {
     if (theConsole && theConsole.log) {
-      theConsole.log(opt_value);
+      theConsole.log(msg);
     }
   } catch (e) {
     // ignore; at least we tried ;-)