Skip to content

Commit

Permalink
Remove unused insertBefore overload (#1631)
Browse files Browse the repository at this point in the history
Mentioned in #1505.
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Dec 1, 2018
1 parent 6e0c6e8 commit 39686e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
15 changes: 1 addition & 14 deletions components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,13 @@ var _ = _self.Prism = {
* As this needs to recreate the object (we cannot actually insert before keys in object literals),
* we cannot just provide an object, we need anobject and a key.
* @param inside The key (or language id) of the parent
* @param before The key to insert before. If not provided, the function appends instead.
* @param before The key to insert before.
* @param insert Object with the key/value pairs to insert
* @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
*/
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];

if (arguments.length == 2) {
insert = arguments[1];

for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
grammar[newToken] = insert[newToken];
}
}

return grammar;
}

var ret = {};

for (var token in grammar) {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,13 @@ var _ = _self.Prism = {
* As this needs to recreate the object (we cannot actually insert before keys in object literals),
* we cannot just provide an object, we need anobject and a key.
* @param inside The key (or language id) of the parent
* @param before The key to insert before. If not provided, the function appends instead.
* @param before The key to insert before.
* @param insert Object with the key/value pairs to insert
* @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
*/
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];

if (arguments.length == 2) {
insert = arguments[1];

for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
grammar[newToken] = insert[newToken];
}
}

return grammar;
}

var ret = {};

for (var token in grammar) {
Expand Down

0 comments on commit 39686e1

Please sign in to comment.