Skip to content

Commit 03cef7d

Browse files
committed
allow the use of Math inside expressions
1 parent 016842c commit 03cef7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/exp-parser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ var KEYWORDS =
1414
',package,private,protected,public,short,static,super,synchronized' +
1515
',throws,transient,volatile' +
1616
// ECMA 5 - use strict
17-
',arguments,let,yield',
17+
',arguments,let,yield' +
18+
// allow using Math in expressions
19+
',Math',
1820

1921
KEYWORDS_RE = new RegExp(["\\b" + KEYWORDS.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g'),
2022
REMOVE_RE = /\/\*(?:.|\n)*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|'[^']*'|"[^"]*"|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,

0 commit comments

Comments
 (0)