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

Switch statement crashes jslint #358

Closed
davideder opened this issue Sep 30, 2021 · 1 comment
Closed

Switch statement crashes jslint #358

davideder opened this issue Sep 30, 2021 · 1 comment

Comments

@davideder
Copy link

Describe the bug

  1. A clear and concise description of what the bug is.

jslint test.js

  1. [JSLint was unable to finish] Cannot read property 'disrupt' of undefined // line 1, column 1

TypeError: [JSLint was unable to finish] Cannot read property 'disrupt' of undefined
at parse_statements (file:///opt/jslint/jslint.mjs:4231:35)
at jslint_phase3_parse (file:///opt/jslint/jslint.mjs:6347:24)
at jslint (file:///opt/jslint/jslint.mjs:862:9)
at jslint_from_file (file:///opt/jslint/jslint.mjs:1075:24)
at jslint_cli (file:///opt/jslint/jslint.mjs:1275:5)
2. Expected 'switch' to be in a function. // line 1, column 1
switch(a)
3. Expected statements before 'default'. // line 4, column 3
default:

  1. Jslint edition:

v2021.9.20

  1. Code snippet (if applicable):

switch(a)
{
case 1:
default:
}

Expected behavior

Expect it to not get a TypeError

@kaizhu256
Copy link
Member

thx for reporting. should be fixed in cl fce38bc

image

kaizhu256 added a commit to kaizhu256/jslint that referenced this issue Oct 20, 2021
- ci - add release-trigger to publish to `@jslint-org/jslint`
- bugfix - fix coverage-report having incorrect http-link to index.html
- bugfix - fix false warning `uninitialized bb` in code `/*jslint node*/\nlet {aa:bb} = {}; bb();`
- bugfix - fix issue jslint-org#358 - switch-statement crashes jslint
- ci - cache coverage-example node-sqlite3 to speed up ci
- ci - rename dir .build/ to .artifact/
- ci - update shell-function shRunWithCoverage() to reduce size of string/argument passed to nodejs by using 2-space-indent
- cli - add cli-command jslint_plugin_vim
- cli - add cli-command v8_coverage_report
- cli - change cli-option `--mode-report` to cli-command `jslint_report=<filename>`
- coverage - relax requirement for coverageDir to be in cwd
- deprecated - cli - add cli-option `--mode-report`
- doc - add api-documentation
- fs - merge file asset_codemirror_rollup.css into index.html
- fs - merge file browser.mjs into index.html
- fs - merge file function.html into help.html
- fs - remove little-used font asset_font_programma_bold.woff2
- fs - rename files with dashes to files with underscore
- jslint - disable linting of embedded javascript in markdown-files
- jslint - relax regexp-warning against using space
- npm - add file package.json and command `npm test`
- style - change naming-convention for non-jslint-core code from underscore to camelCase
- test - add mocha-like test-functions jstestDescribe, jstestIt
kaizhu256 added a commit to kaizhu256/jslint that referenced this issue Oct 20, 2021
- ci - add release-trigger to publish to `@jslint-org/jslint`
- bugfix - fix coverage-report having incorrect http-link to index.html
- bugfix - fix false warning `uninitialized bb` in code `/*jslint node*/\nlet {aa:bb} = {}; bb();`
- bugfix - fix issue jslint-org#358 - switch-statement crashes jslint
- ci - cache coverage-example node-sqlite3 to speed up ci
- ci - rename dir .build/ to .artifact/
- ci - update shell-function shRunWithCoverage() to reduce size of string/argument passed to nodejs by using 2-space-indent
- cli - add cli-command jslint_plugin_vim
- cli - add cli-command v8_coverage_report
- cli - change cli-option `--mode-report` to cli-command `jslint_report=<filename>`
- coverage - relax requirement for coverageDir to be in cwd
- deprecated - cli - add cli-option `--mode-report`
- doc - add api-documentation
- fs - merge file asset_codemirror_rollup.css into index.html
- fs - merge file browser.mjs into index.html
- fs - merge file function.html into help.html
- fs - remove little-used font asset_font_programma_bold.woff2
- fs - rename files with dashes to files with underscore
- jslint - disable linting of embedded javascript in markdown-files
- jslint - relax regexp-warning against using space
- npm - add file package.json and command `npm test`
- style - change naming-convention for non-jslint-core code from underscore to camelCase
- test - add mocha-like test-functions jstestDescribe, jstestIt
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

No branches or pull requests

2 participants