Repository navigation
Fix infinite recursion in the playground - #3305
Merged
Merged
Conversation
duailibe
commented
Nov 22, 2017
| var script = "parser-" + actualParser + ".js"; | ||
|
|
||
| if (!parsersLoaded[actualParser]) { | ||
| if (!parsersLoaded[parser]) { |
Collaborator
Author
There was a problem hiding this comment.
This means it will call importScripts again if you try to load css after loading scss, for example. Is that a big deal?
I could change the check above in line 97 instead to get the actual parser, but this seemed simpler.
Member
duailibe
force-pushed
the
fix-inf-site
branch
from
November 22, 2017 11:40
1ba738c to
12918b4
Compare
duailibe
force-pushed
the
fix-inf-site
branch
from
November 22, 2017 11:41
12918b4 to
13fe739
Compare
ikatyang
approved these changes
Nov 22, 2017
lipis
added a commit
to lipis/prettier
that referenced
this pull request
Nov 24, 2017
* master: Don't add trailing comma after object rest spread in TypeScript (prettier#3313) fix(cli): respect `--ignore-path` when using `--stdin-filepath` (prettier#3309) Fix infinite recursion in playground (prettier#3305) chore: setup markdown formatting (prettier#3224)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #3300
If there's an exception when formatting the code in playground, we check if it's because the parser was not yet loaded. This check was wrong for json and css|less|scss causing the code to recursive infinitely.