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(plugin-inline-script-content): Ensure line numbers are correct when error is at line 1/2/3 #616

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

bengourley
Copy link
Contributor

@bengourley bengourley commented Sep 5, 2019

A bug with the logic adding the surrounding code to the stackframe meant that errors near the start of the document (line 1, 2 or 3) would result in negative-indexed surrounding code, e.g.:

  code: {
    '0': '  Error.apply(this, args)',
    '-2': '<!-- DOC START -->',
    '-1': '<script>function BadThing() {'
  }

This change fixes the logic so that the line numbers are correct and never go below 1.

@bugsnagbot
Copy link
Collaborator

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 40.89 kB 12.24 kB
After 40.89 kB 12.24 kB
± -2 bytes -4 bytes

Generated by 🚫 dangerJS against 1c9fe96

Copy link

@sazap10 sazap10 left a comment

Choose a reason for hiding this comment

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

LGTM, works as expected after testing

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.

3 participants