[patch][cla]use module.url for hint to vm.runInThisContext
in node.js the url hint that is passed to vm.runInThisContext
needs to be the full path to the file url in order for breakpoints to work in "visual" debuggers such as cloud9. changing the hint passed to require.eval
to be module.url
rather than module.id
fixes this. this also causes the browser debuggers that use ////@ sourceURL=
to show the url rather than the module id - i could argue both ways as to which one is better in that case.
this patch would fix it:
-
|
|
|
1212 | 1212 | if(text===cached){ |
1213 | 1213 | cached.call(null); |
1214 | 1214 | }else{ |
1215 | | req.eval(text, module.mid); |
| 1215 | req.eval(text, module.url); |
1216 | 1216 | } |
1217 | 1217 | }catch(e){ |
1218 | 1218 | signal(error, makeError("evalModuleThrew", module)); |
… |
… |
|
1221 | 1221 | if(text===cached){ |
1222 | 1222 | cached.call(null); |
1223 | 1223 | }else{ |
1224 | | req.eval(text, module.mid); |
| 1224 | req.eval(text, module.url); |
1225 | 1225 | } |
1226 | 1226 | } |
1227 | 1227 | injectingCachedModule = 0; |
Change History (8)
Summary: |
use module.url for hint to vm.runInThisContext →
[patch][cla]use module.url for hint to vm.runInThisContext
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
In [27836]: