Unreal.js icon indicating copy to clipboard operation
Unreal.js copied to clipboard

Chrome Inspector log twice

Open 823639792 opened this issue 4 years ago • 2 comments

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); ?

823639792 avatar May 29 '20 03:05 823639792

could be a bug. Can you please tell which version you are using?

Master244 avatar Jun 05 '20 15:06 Master244

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

getnamo avatar Jun 09 '20 07:06 getnamo