Skip to content

Commit

Permalink
Merge pull request #3 from chengfulin/master
Browse files Browse the repository at this point in the history
Modify the issue of forEach callback.
  • Loading branch information
Swatinem committed Apr 8, 2015
2 parents 9de2db1 + a4abe61 commit a442ebd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -51,7 +51,7 @@ function worklist(cfg, transferFunction, options) {
out = {output: out, enqueue: true};
output.set(node, out.output);
if (out.enqueue && (!oldOutput || !equals(out.output, oldOutput)))
successors(node).forEach(list.push.bind(list));
successors(node).forEach(function (aSuccessor) { list.push(aSuccessor); });
}
return output;
};
Expand Down
8 changes: 4 additions & 4 deletions test/availableexpressions.js
Expand Up @@ -33,7 +33,7 @@ function expr(code) {
describe('Available Expressions', function () {
it('should work for basic example', function () {
var actual = doAnalysis('var a = b + c; var c = a + b;');
actual.should.includeEql(expr('a + b'));
actual.should.containEql(expr('a + b'));
});
it('should work for loops', function () {
var actual = doAnalysis(
Expand All @@ -42,8 +42,8 @@ describe('Available Expressions', function () {
'a = a + 1; x = a + b;' +
'} expr;'
);
actual.should.includeEql(expr('a + b'));
actual.should.includeEql(expr('y > a + b'));
actual.should.containEql(expr('a + b'));
actual.should.containEql(expr('y > a + b'));
});
it('should work for branches', function () {
var actual = doAnalysis(
Expand All @@ -55,7 +55,7 @@ describe('Available Expressions', function () {
'y = a + c;' +
'} expr;'
);
actual.should.includeEql(expr('a + b'));
actual.should.containEql(expr('a + b'));
});
});

0 comments on commit a442ebd

Please sign in to comment.