Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #281 Enabling debugging for TS when compiled into a single JS file #266

Merged
merged 13 commits into from
Jul 14, 2015

Conversation

ahmad-farid
Copy link
Contributor

@msftclas
Copy link

msftclas commented Jul 9, 2015

Hi @ahmad-farid, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Ahmad Farid). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

if (originalFileName == null) {
module = new NodeModule(module.Id, javaScriptFileName);
} else {
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you added a bunch of trailing whitespace here. Please remove.

originalFileName = SourceMapper.MapToOriginal(javaScriptFileName);
}

return originalFileName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic would be more readable with a null-coalescing operator
return originalFileName ?? SourceMapper.MapToOriginal(javaScriptFileName);

/// </summary>
/// <param name="javaScriptFileName">JavaScript compiled file.</param>
/// <param name="stackFrame">The current stack frame.</param>
internal string GetOriginalFileName(string javaScriptFileName, NodeStackFrame stackFrame) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of conflating the debugging logic with the source mapping logic... probably best to move the core logic to SourceMapper.cs (which would accepts line/column arguments), and use a helper here if necessary. This would also simplify the unit test.

@mousetraps
Copy link
Contributor

@gilbertw - you have more experience with this part of the codebase - mind chiming in?

@mousetraps
Copy link
Contributor

left one more comment you may not have seen (girhub notifications are annoying), but lgtm other than that

@@ -21,12 +21,13 @@
using System.Windows.Threading;
using System.Xml.Linq;
using Microsoft.NodejsTools;
using Microsoft.NodejsTools.Debugger;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't need this reference anymore, right?

@mousetraps mousetraps changed the title Enabling debugging for TS when compiled into a single JS file Fix #281 Enabling debugging for TS when compiled into a single JS file Jul 13, 2015
mousetraps added a commit that referenced this pull request Jul 14, 2015
Fix #281 Enabling debugging for TS when compiled into a single JS file
@mousetraps mousetraps merged commit 948364d into microsoft:master Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants