Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

failing return inside a block test

  • Loading branch information...
commit 99ab83cb3d1ce950b19fa3efe9e29c7427f90e45 1 parent cc6ae36
@substack authored
Showing with 22 additions and 0 deletions.
  1. +16 −0 test/block.js
  2. +6 −0 test/sources/block.js
View
16 test/block.js
@@ -0,0 +1,16 @@
+var stackedy = require('../');
+var test = require('tap').test;
+
+var fs = require('fs');
+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();
+
+ stack.on('error', function (err, c) {
+ t.fail(err);
+ });
+});
View
6 test/sources/block.js
@@ -0,0 +1,6 @@
+exports.f = function () {
+ var x = 2 * 5 + 5;
+ {
+ return x / 3;
+ }
+};
Please sign in to comment.
Something went wrong with that request. Please try again.