Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Convert to ES6 Class Refactoring fails with empty catch clause #18541

Copy link
Copy link
@hbenl

Description

@hbenl
Issue body actions

TypeScript Version: nightly (2.6.0-dev.20170916)

Try the refactoring on the following code:
Code

function MyClass() {
}
MyClass.prototype.foo = function() {
    try { doStuff(); } catch(e) {}
}

Expected behavior:
The code is refactored

Actual behavior:
Typescript throws an Error:

[Error  - 11:06:40] 'getEditsForRefactor' request failed with error.
Error processing request. Debug Failure. False expression.
Error: Debug Failure. False expression.
    at getPos (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:72918:22)
    at assignPositionsToNodeArray (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73354:29)
    at Object.visitEachChild (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:43020:45)
    at assignPositionsToNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73342:30)
    at visitNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:42792:23)
    at Object.visitEachChild (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:43052:43)
    at assignPositionsToNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73342:30)
    at Object.visitNodes (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:42829:48)
    at assignPositionsToNodeArray (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73349:30)
    at Object.visitEachChild (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:43020:45)
    at assignPositionsToNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73342:30)
    at visitNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:42792:23)
    at visitFunctionBody (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:42875:23)
    at Object.visitEachChild (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:42914:510)
    at assignPositionsToNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73342:30)
    at Object.visitNodes (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:42829:48)
    at assignPositionsToNodeArray (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73349:30)
    at Object.visitEachChild (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:43060:355)
    at assignPositionsToNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73342:30)
    at getNonformattedText (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73318:52)
    at ChangeTracker.getFormattedTextOfNode (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73285:40)
    at ChangeTracker.computeNewText (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73279:33)
    at c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73254:44
    at Map.forEach (native)
    at ChangeTracker.getChanges (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73247:32)
    at Object.getEditsForAction (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:75033:42)
    at Object.getEditsForRefactor (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:73512:41)
    at Object.getEditsForRefactor (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:77543:32)
    at IOSession.Session.getEditsForRefactor (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:83445:59)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:82407:61)
    at c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:83622:88
    at IOSession.Session.executeWithRequestId (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:83613:28)
    at IOSession.Session.executeCommand (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:83622:33)
    at IOSession.Session.onMessage (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:83642:35)
    at Interface.<anonymous> (c:\GitTF\Aktuell\WebDispo\node_modules\typescript\lib\tsserver.js:84789:27)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:191:7)
    at Interface._onLine (readline.js:241:10)
    at Interface._normalWrite (readline.js:384:12)
    at Socket.ondata (readline.js:101:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)

@Andy-MS this sounds very similar to #18437 which you fixed last week.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.