Skip to content

Commit

Permalink
Port over substr -> substring
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 16, 2017
1 parent 256fb5e commit fa3ff4f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ function coreHighlight(name, value, ignore, prefix, continuation) {
match = top.terminators.exec(value);

while (match) {
count = processLexeme(
value.substr(offset, match.index - offset),
match[0]
);

count = processLexeme(value.substring(offset, match.index), match[0]);
offset = top.terminators.lastIndex = match.index + count;
match = top.terminators.exec(value);
}
Expand Down Expand Up @@ -424,7 +420,7 @@ function coreHighlight(name, value, ignore, prefix, continuation) {
keyword = top.lexemesRe.exec(modeBuffer);

while (keyword) {
addText(modeBuffer.substr(lastIndex, keyword.index - lastIndex), nodes);
addText(modeBuffer.substring(lastIndex, keyword.index), nodes);

submatch = keywordMatch(top, keyword);

Expand Down

0 comments on commit fa3ff4f

Please sign in to comment.