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

make the SourceMap node validation more precise and possibly slightly more performant; related to #385 #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GerHobbelt
Copy link
Contributor

make the SourceMap node validation more precise and possibly slightly more performant: check for the okay/good cases before checking the various error situations. Hence the first error check (with its extensive report message) has been moved down. The check has been duplicated for the 'generated' section of the mapping as that's another potential user app programmer error source.

The diff is a little large because I turned on prettier for all my branches for easier merging/diffing (once one has moved to a prettier-formatted codebase).

Extracted from SHA-1: 151593b * stricter validation for source and generated line/column: when they exist, they MUST be numbers. Related to #385 (which is not fixed by this, mind you). For this patch I choose to stick with the exception being thrown as that better ensures code/mapping quality AFAIAC.

As all error validation checks are now in a single spot and within a single conditional chunk, source-map can choose to resolve by, for example, providing a source-map option which enables/disables these checks.

…formant: check for the okay/good cases before checking the various error situations. Hence the first error check (with its extensive report message) has been moved down. The check has been duplicated for the 'generated' section of the mapping as that's another potential user app programmer error source.

The diff is a little large because I turned on `prettier` for all my branches for easier merging/diffing (once one has moved to a `prettier`-formatted codebase).

Extracted from SHA-1: 151593b * stricter validation for source and generated line/column: when they exist, they MUST be numbers. Related to mozilla#385 (which is not fixed by this, mind you). For this patch I choose to stick with the exception being thrown as that better ensures code/mapping quality AFAIAC.

As all error validation checks are now in a single spot and within a single conditional chunk, source-map can choose to resolve by, for example, providing a source-map option which enables/disables these checks.
@coveralls
Copy link

coveralls commented Jun 18, 2019

Pull Request Test Coverage Report for Build 558

  • 7 of 9 (77.78%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 88.336%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/source-map-generator.js 7 9 77.78%
Totals Coverage Status
Change from base Build 550: -0.05%
Covered Lines: 827
Relevant Lines: 915

💛 - Coveralls

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.

2 participants