Skip to content

[lint addon] fix startLinting, onChange#3104

Closed
coderaiser wants to merge 1 commit intocodemirror:masterfrom
coderaiser:patch-1
Closed

[lint addon] fix startLinting, onChange#3104
coderaiser wants to merge 1 commit intocodemirror:masterfrom
coderaiser:patch-1

Conversation

@coderaiser
Copy link
Copy Markdown
Contributor

When option lint set to jshint config and mode set to javascript, file.js is loaded - everything is OK.
But, if after that mode is changed to another one with no lint support (gfm for example) and set lint to false - after setting up value, errors are occur:

Uncaught TypeError: Cannot read property 'options' of undefined in startLinting
Uncaught TypeError: Cannot read property 'timeout' of undefined in onChange

Check added. `state` could be undefined
marijnh added a commit that referenced this pull request Feb 26, 2015
@marijnh
Copy link
Copy Markdown
Member

marijnh commented Feb 26, 2015

Good point. Attached patch solves the problem in a slightly different way (making sure the timeout is canceled when the option is reset). Could you verify that this works for you?

@marijnh marijnh closed this Feb 26, 2015
@coderaiser
Copy link
Copy Markdown
Contributor Author

Everything works good, thank you. And it's definitely better to clearTimeout then just ignore it as I did.

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