Permalink
Browse files

caught test from stackedy

  • Loading branch information...
1 parent e778b6a commit 5b11b3e464d2d2a3db2529e92b203808387bdc22 @substack committed May 15, 2012
Showing with 29 additions and 0 deletions.
  1. +20 −0 test/caught.js
  2. +9 −0 test/sources/caught.js
View
@@ -0,0 +1,20 @@
+var fritter = require('../');
+var vm = require('vm');
+var test = require('tap').test;
+
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/sources/caught.js', 'utf8');
+
+test('caught', function (t) {
+ var fry = fritter(src);
+
+ fry.on('error', function (err, c) {
+ t.fail(err);
+ });
+
+ setTimeout(function () {
+ t.end();
+ }, 100);
+
+ vm.runInNewContext(fry.source, fry.context);
+});
View
@@ -0,0 +1,9 @@
+function f () {
+ try {
+ throw 'a'
+ }
+ catch (err) {}
+}
+
+try { f() }
+catch (err) {}

0 comments on commit 5b11b3e

Please sign in to comment.