From 47a06b1fdcd20e7e86815e40b625190b88a433f1 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Sat, 19 Sep 2015 05:03:45 +0200 Subject: [PATCH] Pretty print classes in console --- .../APP/frontend/js/bootstrap/module-internal.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/module-internal.js b/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/module-internal.js index 4e05fbf121..e05e7ec2d9 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/module-internal.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/module-internal.js @@ -1226,6 +1226,7 @@ function printObject (object, context) { var funcRE = /function ([^\(]*)?\(\) \{ \[native code\] \}/; var func2RE = /function ([^\(]*)?\((.*)\) \{/; +var classRE = /class ([^{]*)? \{/; exports.printRecursive = printRecursive = function (value, context) { @@ -1321,8 +1322,15 @@ exports.printRecursive = printRecursive = function (value, context) { } } else { - f = f.substr(8, f.length - 10).trim(); - context.output += '[Function "' + f + '" ...]'; + m = classRE.exec(f); + + if (m !== null) { + context.output += 'class ' + m[1] + ' { ... }'; + } + else { + f = f.substr(8, f.length - 10).trim(); + context.output += '[Function "' + f + '" ...]'; + } } } }