Commit c27d68ab authored by James Halliday's avatar James Halliday

passing return test

parent 383bfe6e
......@@ -7,6 +7,7 @@
"browser-unpack": "bin/cmd.js"
},
"dependencies": {
"acorn": "^1.0.3",
"concat-stream": "~1.2.1",
"esprima-fb": "3001.1.0-dev-harmony-fb",
"minimist": "0.0.5"
......
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
return console.log('whatever');
},{}]},{},[1]);
return console.log('whatever');
var test = require('tape');
var unpack = require('../');
var pack = require('browser-pack');
var concat = require('concat-stream');
var vm = require('vm');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/files/return.js', 'utf8');
test('return', function (t) {
t.plan(1);
var p = pack({ raw: true });
p.pipe(concat(function (body) {
var log = function (msg) {
t.equal(msg, 'whatever');
};
var c = { console: { log: log } };
vm.runInNewContext(body.toString('utf8'), c);
}));
var rows = unpack(src);
rows.forEach(function (row) { p.write(row) });
p.end();
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment