summaryrefslogtreecommitdiffstats
path: root/webapp/non_npm_dependencies/katex/src/ParseError.js
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-09-06 23:04:13 -0700
committerChristopher Speller <crspeller@gmail.com>2017-09-06 23:11:58 -0700
commitd8bd57901e33a7057e26e782e295099ffcc0da89 (patch)
treee12dfc8cad42b1576756d19d7fbfd82646a009bf /webapp/non_npm_dependencies/katex/src/ParseError.js
parent7bc8e9a08dfde56387f946fdf5086252aa4d0491 (diff)
downloadchat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.gz
chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.bz2
chat-d8bd57901e33a7057e26e782e295099ffcc0da89.zip
Removing webapp
Diffstat (limited to 'webapp/non_npm_dependencies/katex/src/ParseError.js')
-rw-r--r--webapp/non_npm_dependencies/katex/src/ParseError.js40
1 files changed, 0 insertions, 40 deletions
diff --git a/webapp/non_npm_dependencies/katex/src/ParseError.js b/webapp/non_npm_dependencies/katex/src/ParseError.js
deleted file mode 100644
index 320f0bd69..000000000
--- a/webapp/non_npm_dependencies/katex/src/ParseError.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * This is the ParseError class, which is the main error thrown by KaTeX
- * functions when something has gone wrong. This is used to distinguish internal
- * errors from errors in the expression that the user provided.
- */
-function ParseError(message, lexer, position) {
- var error = "KaTeX parse error: " + message;
-
- if (lexer !== undefined && position !== undefined) {
- // If we have the input and a position, make the error a bit fancier
-
- // Prepend some information
- error += " at position " + position + ": ";
-
- // Get the input
- var input = lexer._input;
- // Insert a combining underscore at the correct position
- input = input.slice(0, position) + "\u0332" +
- input.slice(position);
-
- // Extract some context from the input and add it to the error
- var begin = Math.max(0, position - 15);
- var end = position + 15;
- error += input.slice(begin, end);
- }
-
- // Some hackery to make ParseError a prototype of Error
- // See http://stackoverflow.com/a/8460753
- var self = new Error(error);
- self.name = "ParseError";
- self.__proto__ = ParseError.prototype;
-
- self.position = position;
- return self;
-}
-
-// More hackery
-ParseError.prototype.__proto__ = Error.prototype;
-
-module.exports = ParseError;