Permalink
Browse files

block test now passes with removal of block wrapper

  • Loading branch information...
1 parent 99ab83c commit 3506c94b25c6ad2325c856e2dd22659f3304cc9c @substack committed Sep 28, 2011
Showing with 8 additions and 5 deletions.
  1. +1 −1 index.js
  2. +6 −3 test/block.js
  3. +1 −1 test/sources/block.js
View
@@ -260,7 +260,7 @@ Stack.prototype.compile = function (context, opts) {
+ '})');
}
else if (node.name === 'block') {
- node.wrap('{' + ex(ix, '%s') + '}');
+ //node.wrap('{' + ex(ix, '%s') + '}');
}
else if (node.name === 'defun') {
var name = node.value[0];
View
@@ -6,9 +6,12 @@ var src = fs.readFileSync(__dirname + '/sources/block.js', 'utf8');
test('return in a block', function (t) {
t.plan(1);
var context = { exports : {} };
- var stack = stackedy(src, { filename : 'zoom.js' }).run(context);
- t.equal(context.exports.f(), 5);
- t.end();
+ var stack = stackedy(src).run(context);
+
+ process.nextTick(function () {
+ t.equal(context.exports.blockReturn(), 5);
+ t.end();
+ });
stack.on('error', function (err, c) {
t.fail(err);
View
@@ -1,4 +1,4 @@
-exports.f = function () {
+exports.blockReturn = function () {
var x = 2 * 5 + 5;
{
return x / 3;

0 comments on commit 3506c94

Please sign in to comment.