use null prototype objects for languages/aliases#2636
Merged
joshgoebel merged 3 commits intohighlightjs:masterfrom Jul 21, 2020
Merged
use null prototype objects for languages/aliases#2636joshgoebel merged 3 commits intohighlightjs:masterfrom
joshgoebel merged 3 commits intohighlightjs:masterfrom
Conversation
joshgoebel
reviewed
Jul 21, 2020
Member
joshgoebel
left a comment
There was a problem hiding this comment.
This looks ok, but I'm curious did you run into a real life problem that you're trying to solve or...?
Contributor
Author
|
Discord uses |
joshgoebel
approved these changes
Jul 21, 2020
Member
|
@night Thanks so much! |
joshgoebel
pushed a commit
that referenced
this pull request
Jul 23, 2020
Fix: Discord uses getLanguage to validate that a language specified exists in highlightJS and retrieve metadata about the language for code block highlighting in chat. Because highlightJS returns prototype values instead of the highlight languages themselves, the result is a few different bugs in our clients which expect the return type to be only `Language | undefined`.
joshgoebel
added a commit
that referenced
this pull request
Jul 24, 2020
This was referenced Nov 24, 2020
Merged
1 task
1 task
This was referenced Nov 28, 2020
Closed
This was referenced Feb 9, 2022
This was referenced Mar 15, 2022
1 task
1 task
This was referenced May 28, 2022
Open
1 task
This was referenced Jun 18, 2022
Closed
1 task
1 task
1 task
1 task
This was referenced Oct 29, 2022
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
getLanguagecurrently returns values for object prototype method names. By swapping to objects with a null prototype, we can fix this weird behavior.