Skip to content

Conversation

amcasey
Copy link
Member

@amcasey amcasey commented Jun 2, 2017

For example, do not report unreachable code in JS files unless --checkjs is passed.

amcasey added 2 commits June 1, 2017 18:10
Report unreachable code in JS files when --checkjs is passed, but not
otherwise.
@msftclas
Copy link

msftclas commented Jun 2, 2017

@amcasey,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

// For JavaScript files, we don't want to report semantic errors unless explicitly requested.
const includeCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options);
const checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : [];
const includeBindAndCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options);
Copy link
Contributor

Choose a reason for hiding this comment

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

emptyArray instead of []

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do. What's the difference? Fewer allocations?

const checkDiagnostics = includeCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : [];
const includeBindAndCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options);
const bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : [];
const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : [];
Copy link
Contributor

Choose a reason for hiding this comment

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

and here too

@mhegazy
Copy link
Contributor

mhegazy commented Jun 2, 2017

also you need to accept baselines jake runtests-parallel then jake baseline-accept

@amcasey
Copy link
Member Author

amcasey commented Jun 2, 2017

@mhegazy, rather than updating the baselines, would it make more sense to add set checkjs in the newly failing tests? It looks like they wanted the errors.

@mhegazy
Copy link
Contributor

mhegazy commented Jun 2, 2017

@mhegazy, rather than updating the baselines, would it make more sense to add set checkjs in the newly failing tests? It looks like they wanted the errors.

sounds good.

@amcasey
Copy link
Member Author

amcasey commented Jun 2, 2017

@mhegazy, a couple of the baselines are showing some new bind errors. Can you please confirm that they're acceptable?

@sandersn
Copy link
Member

sandersn commented Jun 2, 2017

The baselines match the behaviour of .ts files, so the changes are fine. Although the strict mode messages are basically dupes of the normal messages, which is not great and should maybe be fixed separately.

@amcasey amcasey merged commit 71e25cd into microsoft:master Jun 2, 2017
@amcasey amcasey deleted the Vso411288 branch June 2, 2017 20:11
@amcasey
Copy link
Member Author

amcasey commented Jun 2, 2017

I'll start porting this to 2.3 now.

@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants