Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

debugger: TypeError: Cannot call method 'replace' of undefined #6453

Closed
bnoordhuis opened this issue Nov 2, 2013 · 2 comments
Closed

debugger: TypeError: Cannot call method 'replace' of undefined #6453

bnoordhuis opened this issue Nov 2, 2013 · 2 comments

Comments

@bnoordhuis
Copy link
Member

$ git rev-list --abbrev-commit HEAD^..HEAD
d2a6002
$ out/Release/node debug -p $(pgrep node)
connecting to port 5858... ok
debug> setBreakpoint(20)
Warning: script 'undefined' was not loaded yet.

_debugger.js:1396
      var escapedPath = script.replace(/([/\\.?*()^${}|[\]])/g, '\\$1');
                               ^
TypeError: Cannot call method 'replace' of undefined
    at Interface.setBreakpoint (_debugger.js:1396:32)
    at repl:1:1
    at Object.exports.runInContext (vm.js:60:17)
    at Interface.controlEval (_debugger.js:969:21)
    at REPLServer.b [as eval] (domain.js:251:18)
    at Interface.<anonymous> (repl.js:277:12)
    at Interface.EventEmitter.emit (events.js:103:17)
    at Interface._onLine (readline.js:194:10)
    at Interface._line (readline.js:523:8)
    at Interface._ttyWrite (readline.js:798:14)

/cc @bajtos - seems to have been introduced in 5db936d.

@bajtos
Copy link

bajtos commented Nov 4, 2013

See the pull request for a fix.

This is the behaviour before 5db936d (which was BTW back-ported to v0.10 as a32a243):

$ node -v
v0.10.5
$ node debug -p $(pgrep node)
connecting... ok
debug> setBreakpoint(100)
Script : undefined not found
debug>

chrisdickinson pushed a commit that referenced this issue Dec 17, 2014
Fix Interface.setBreakpoint() to correctly handle an attempt to set a
breakpoint in the current script when there is no current script.
This usually happens when the debugged process is not paused.

Fixes: #6453
PR-URL: #6460
Reviewed-By: Chris Dickinson <[email protected]>
@jasnell
Copy link
Member

jasnell commented May 28, 2015

Seems to have been resolved.

@jasnell jasnell closed this as completed May 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants