mirror of https://gitee.com/bigwinds/arangodb
Pretty print classes in console
This commit is contained in:
parent
fb2d334741
commit
47a06b1fdc
|
@ -1226,6 +1226,7 @@ function printObject (object, context) {
|
||||||
|
|
||||||
var funcRE = /function ([^\(]*)?\(\) \{ \[native code\] \}/;
|
var funcRE = /function ([^\(]*)?\(\) \{ \[native code\] \}/;
|
||||||
var func2RE = /function ([^\(]*)?\((.*)\) \{/;
|
var func2RE = /function ([^\(]*)?\((.*)\) \{/;
|
||||||
|
var classRE = /class ([^{]*)? \{/;
|
||||||
|
|
||||||
exports.printRecursive = printRecursive = function (value, context) {
|
exports.printRecursive = printRecursive = function (value, context) {
|
||||||
|
|
||||||
|
@ -1321,8 +1322,15 @@ exports.printRecursive = printRecursive = function (value, context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
f = f.substr(8, f.length - 10).trim();
|
m = classRE.exec(f);
|
||||||
context.output += '[Function "' + f + '" ...]';
|
|
||||||
|
if (m !== null) {
|
||||||
|
context.output += 'class ' + m[1] + ' { ... }';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
f = f.substr(8, f.length - 10).trim();
|
||||||
|
context.output += '[Function "' + f + '" ...]';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue