diff options
author | Matth?us G. Chajdas <dev@anteru.net> | 2019-11-10 13:56:53 +0100 |
---|---|---|
committer | Matth?us G. Chajdas <dev@anteru.net> | 2019-11-10 13:56:53 +0100 |
commit | 1dd3124a9770e11b6684e5dd1e6bc15a0aa3bc67 (patch) | |
tree | 87a171383266dd1f64196589af081bc2f8e497c3 /tests/examplefiles/evil_regex.js | |
parent | f1c080e184dc1bbc36eaa7cd729ff3a499de568a (diff) | |
download | pygments-master.tar.gz |
Diffstat (limited to 'tests/examplefiles/evil_regex.js')
-rw-r--r-- | tests/examplefiles/evil_regex.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/examplefiles/evil_regex.js b/tests/examplefiles/evil_regex.js deleted file mode 100644 index 3839c3f4..00000000 --- a/tests/examplefiles/evil_regex.js +++ /dev/null @@ -1,48 +0,0 @@ -/regexp/.test(foo) || x = [/regexp/,/regexp/, /regexp/, // comment -// comment -/regexp/]; -if (/regexp/.test(string)) -{/regexp/.test(string);}; -x =/regexp/; -x = /regexp/; -if (0</regexp/.exec(string) || 1>/regexp/.exec(string)) -x = { u:/regexp/, v: /regexp/ }; -foo();/regexp/.test(string); /regexp/.test(string); -if (!/regexp/) foobar(); -x = u %/regexp/.exec(string) */regexp/.exec(string) / /regexp/.exec(string); -x = u?/regexp/.exec(string) : v +/regexp/.exec(string) -/regexp/.exec(string); -a = u^/regexp/.exec(string) &/regexp/.exec(string) |/regexp/.exec(string) +~/regexp/.exec(string); -x = /regexp/ /* a comment */ ; -x = /[reg/exp]/; -x = 4/2/i; -x = (a == b) ?/* this is a comment */ c : d; -/// a comment // -a = /regex//2/1; //syntactically correct, returns NaN - - - - -/* original examples */ - -// regex - -blah(/abc/); -x = /abc/; -x = /abc/.match; - -// math - -blah(1/2); //comment -x = 1 / 2 / 3; -x = 1/1/.1; - -// broken - -x=/1/; -x=1/a/g; -x=a/a/g; - -// real-world - -var x = 1/(1+Math.sqrt(sum)); // convert to number between 1-0 -return Math.round((num / den) * 100)/100; |