Skip to content

Commit

Permalink
#71 test static closure
Browse files Browse the repository at this point in the history
  • Loading branch information
ichiriac committed Jul 9, 2017
1 parent 6d253c1 commit f76a460
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/functionTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,17 @@ describe('Function tests', function() {
fn.body.kind.should.be.exactly('block');
});

it('test static closure', function() {
// from expr
var ast = parser.parseEval('$a = static function() {};');
var fn = ast.children[0].right;
fn.kind.should.be.exactly('closure');
fn.isStatic.should.be.exactly(true);
// from statement
ast = parser.parseEval('static function() {};');
fn = ast.children[0];
fn.kind.should.be.exactly('closure');
fn.isStatic.should.be.exactly(true);
});

});

0 comments on commit f76a460

Please sign in to comment.