summaryrefslogtreecommitdiff
path: root/tests/examplefiles/js/regex.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examplefiles/js/regex.js')
-rw-r--r--tests/examplefiles/js/regex.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/examplefiles/js/regex.js b/tests/examplefiles/js/regex.js
new file mode 100644
index 00000000..7790cb00
--- /dev/null
+++ b/tests/examplefiles/js/regex.js
@@ -0,0 +1,22 @@
+// 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;