Unreal.js
Unreal.js copied to clipboard
Chrome Inspector log twice
if I connect by chrome inspector, and input : console.log(123); then output: 123 123 Stack:
'log error warn info void assert'.split(' ').forEach(x=>{
let o = console[x].bind(console);
let y = $console[x].bind($console);
console['$' + x] = o;
console[x] = function() {
y(...arguments);
return o(...arguments);
}
}
)
what different console and $console? and why y(...arguments); and o(...arguments); ?
could be a bug. Can you please tell which version you are using?
Removing the y variable from definition and the console[x] seems to fix the double print. Relevant line is: https://github.com/ncsoft/Unreal.js-core/blob/master/Source/V8/Private/Inspector.cpp#L450
Resulting text should be something like:
'log error warn info void assert'.split(' ').forEach(x=>{
let o = console[x].bind(console);
console['$' + x] = o;
console[x] = function() {
return o(...arguments);
}
}
)
NB: unsure of where $console[x] might be used, so YMMV with this fix