Permalink
Browse files

Bug fix: rspivak#22

  • Loading branch information...
rspivak committed Feb 4, 2012
1 parent c88bc48 commit c250efc7dc97c42f03785b9bae8e97c868c4982e
Showing with 269 additions and 261 deletions.
  1. +1 −0 src/slimit/parser.py
  2. +7 −1 src/slimit/tests/test_parser.py
  3. +261 −260 src/slimit/yacctab.py
View
@@ -307,6 +307,7 @@ def p_member_expr(self, p):
def p_member_expr_nobf(self, p):
"""member_expr_nobf : primary_expr_no_brace
| function_expr
| member_expr_nobf LBRACKET expr RBRACKET
| member_expr_nobf PERIOD identifier
| NEW member_expr arguments
@@ -82,6 +82,13 @@ def test_bug_no_semicolon_at_the_end_of_block_plus_newline_at_eof(self):
tree = parser.parse(text)
self.assertTrue(bool(tree.children()))
def test_function_expression_is_part_of_member_expr_nobf(self):
# https://github.com/rspivak/slimit/issues/22
# The problem happened to be that function_expr was not
# part of member_expr_nobf rule
text = 'window.done_already || function () { return "slimit!" ; }();'
self.assertTrue(bool(Parser().parse(text).children()))
class ASITestCase(unittest.TestCase):
TEST_CASES = [
@@ -181,7 +188,6 @@ class ASITestCase(unittest.TestCase):
}
"""),
]
def test_throw_statement(self):
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit c250efc

Please sign in to comment.