npm install
node traceur-runner.js main.js
Last active
August 29, 2015 14:08
-
-
Save OliverJAsh/fd98c53b62eaa32f5e56 to your computer and use it in GitHub Desktop.
longjohn interoperability with Traceur call stacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint esnext: true, node: true */ | |
require('longjohn'); | |
var bar = () => { throw new Error('foo'); }; | |
var foo = () => new Promise((resolve) => setTimeout(() => resolve(bar()), 0)); | |
foo() | |
.catch(error => console.error(error)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "traceur-runner.js", | |
"dependencies": { | |
"longjohn": "^0.2.4", | |
"traceur": "0.0.72", | |
"traceur-source-maps": "^1.0.3" | |
}, | |
"devDependencies": {}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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; | |
}); | |
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