Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Created November 13, 2014 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverJAsh/0a9fb23dc3ea9bc7914c to your computer and use it in GitHub Desktop.
Save OliverJAsh/0a9fb23dc3ea9bc7914c to your computer and use it in GitHub Desktop.
longjohn interoperability with Traceur call stacks
npm install
node traceur-runner.js main.js
/* jshint esnext: true, node: true */
class Foo {
get(){}
}
var foo = () => {
setTimeout(() => {
throw new Error('foo');
}, 0);
};
var bar = () => {
foo();
};
bar();
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "traceur-runner.js",
"dependencies": {
"longjohn": "^0.2.4",
"traceur": "0.0.74",
"traceur-source-maps": "^1.0.3"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
'use strict';
/* jshint node: true */
var traceur = require('traceur');
// require('traceur-source-maps').install(traceur);
var path = require('path');
traceur.require.makeDefault(function (modulePath) {
var isDependency = modulePath.indexOf('node_modules') !== -1;
return ! isDependency;
// });
}, { sourceMaps: true });
require(path.resolve(process.cwd(), process.argv[2]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment