Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug fix: #34

  • Loading branch information...
commit 887e3bbe3aa8083df84a5b183d8ec27cc952bf28 1 parent 6d580a8
@rspivak authored
Showing with 9 additions and 2 deletions.
  1. +4 −2 src/slimit/lexer.py
  2. +5 −0 src/slimit/tests/test_minifier.py
View
6 src/slimit/lexer.py
@@ -208,8 +208,10 @@ def next(self):
'DO', 'ELSE', 'FINALLY', 'FOR', 'FUNCTION', 'IF', 'IN',
'INSTANCEOF', 'NEW', 'RETURN', 'SWITCH', 'THIS', 'THROW', 'TRY',
'TYPEOF', 'VAR', 'VOID', 'WHILE', 'WITH', 'NULL', 'TRUE', 'FALSE',
- # future reserved words
- # 'CLASS', 'CONST', 'ENUM', 'EXPORT', 'EXTENDS', 'IMPORT', 'SUPER',
+ # future reserved words - well, it's uncommented now to make
+ # IE8 happy because it chokes up on minification:
+ # obj["class"] -> obj.class
+ 'CLASS', 'CONST', 'ENUM', 'EXPORT', 'EXTENDS', 'IMPORT', 'SUPER',
)
keywords_dict = dict((key.lower(), key) for key in keywords)
View
5 src/slimit/tests/test_minifier.py
@@ -357,6 +357,11 @@ def assertMinified(self, source, expected):
("""foo["bar'"]=42;""", """foo["bar'"]=42;"""),
('foo["bar bar"];', 'foo["bar bar"];'),
('foo["bar"+"bar"];', 'foo["bar"+"bar"];'),
+ # https://github.com/rspivak/slimit/issues/34
+ # test some reserved keywords
+ ('foo["for"];', 'foo["for"];'),
+ ('foo["class"];', 'foo["class"];'),
+
# https://github.com/rspivak/slimit/issues/21
# c||(c=393,a=323,b=2321); --> c||c=393,a=323,b=2321; ERROR
Please sign in to comment.
Something went wrong with that request. Please try again.