node icon indicating copy to clipboard operation
node copied to clipboard

Fix broken links generated from Node modules in DevTools

Open ghostoy opened this issue 9 years ago • 2 comments

Compiled scripts from Node were set to weak, which caused the script object in V8 being GCed shortly. Hence links of the script shown in console of DevTools become invalid after GC. This patch saved compiled scripts from Node globally to survival from GC.

Fixed nwjs/nw.js#4269

ghostoy avatar Mar 28 '16 06:03 ghostoy

Is this PR the only one needed to fix 4269?

rogerwang avatar Mar 28 '16 06:03 rogerwang

@rogerwang ~~I just updated the patch. The idea is similar as previous patch, but moved the implementation from C++ to JS. And it also fixes the broken links in app window by transforming filename into file:// protocol.~~ Adding file:// protocol will break libraries, like bindings, which detects calling script from stack trace. So I've removed this part from patch.

And yes, it's the only patch to fix the issue. I'll submit test case to nw.js repo later.

ghostoy avatar Mar 28 '16 07:03 ghostoy