Skip to content

Commit f76a460

Browse files
committed
glayzzle#71 test static closure
1 parent 6d253c1 commit f76a460

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/functionTests.js

+12
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,17 @@ describe('Function tests', function() {
7878
fn.body.kind.should.be.exactly('block');
7979
});
8080

81+
it('test static closure', function() {
82+
// from expr
83+
var ast = parser.parseEval('$a = static function() {};');
84+
var fn = ast.children[0].right;
85+
fn.kind.should.be.exactly('closure');
86+
fn.isStatic.should.be.exactly(true);
87+
// from statement
88+
ast = parser.parseEval('static function() {};');
89+
fn = ast.children[0];
90+
fn.kind.should.be.exactly('closure');
91+
fn.isStatic.should.be.exactly(true);
92+
});
8193

8294
});

0 commit comments

Comments
 (0)