Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Block uncomment throws exception near bottom of file #2887

Closed
njx opened this issue Feb 15, 2013 · 8 comments
Closed

Block uncomment throws exception near bottom of file #2887

njx opened this issue Feb 15, 2013 · 8 comments
Assignees
Milestone

Comments

@njx
Copy link

njx commented Feb 15, 2013

  1. Open the Getting Started project
  2. Open and close an inline editor
  3. Go to the CSS file and select the last 2 lines within the last selector
  4. Block comment
  5. Block uncomment

Result: exception thrown in CodeMirror (although things seem to work fine afterward)


Original description:

Failures:

  • EditorCommandHandlers Block comment/uncomment should block uncomment, cursor in whitespace within block comment.
  • EditorCommandHandlers Block comment/uncomment should block uncomment, selection in whitespace within block comment.

Both seem to be the same issue: TypeError: Cannot call method 'chunkSize' of undefined.

This only happens if certain other test suites are run before this one (so you have to run all the test suites, and the tests have to load in a certain order).

@ghost ghost assigned peterflynn Feb 15, 2013
@njx
Copy link
Author

njx commented Feb 15, 2013

To @peterflynn

@TomMalbran
Copy link
Contributor

I think it might be problem with #2335

@peterflynn
Copy link
Member

I ran unit tests (the full "All") manually on the Jenkins machine and they all pass. Also ran this suite locally on my machine and it passes, and NJ confirms same on his machine.

I'm not seeing any evidence linking this to the tokenization race condition, other than it being not 100% reproducible. In #2335, the symptom was the command getting stale tokens back from CM and thinking some stuff was commented out when it wasn't (or vice versa). Here the symptom is CM crashing in updateDisplay() after we've made some edits... which often implies we passed it undefined or NaN as a line number at some point.

@peterflynn
Copy link
Member

Looking like a CM bug -- and it only occurs if CM has ever seen hidden lines (e.g. an inline editor before), which means whether or not this repros depends on the (nondeterministic) order that other test suites got run in. Will file an issue and disable the two tests for now.

@peterflynn
Copy link
Member

Filed codemirror/codemirror5#1255. Put up a pull request for disabling the tests, so reducing this to Low & adding Tracking label.

@peterflynn
Copy link
Member

Adding new info: there is a user-visible bug here too, but it's a little tricky to hit and not readily apparent unless you have Dev Tools open. Bumping up to Medium, though...

The CM bug is now fixed, so this will be fixed with our next merge from upstream.

njx pushed a commit that referenced this issue Feb 19, 2013
- Update SHA to our CodeMirror fork's master, which is now clean with upstream
  (brackets-sprint20 branch in the adobe/CodeMirror2 fork is no longer needed)
- Fix htmlmixed mode to specify parameters for handling mustache/handlebars
  templates, as required by latest CodeMirror
- Reinstate commented-out unit tests from #2887 since the underlying CM bug
  should now be fixed
@njx
Copy link
Author

njx commented Feb 19, 2013

FBNC to @peterflynn

@peterflynn
Copy link
Member

Confirmed fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants