Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "es6-class", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/square/es6-class", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -7,3 +7,3 @@ var assert = require('assert'); | ||
var recast = require('recast'); | ||
var types = require('ast-types'); | ||
var types = recast.types; | ||
var n = types.namedTypes; | ||
@@ -371,3 +371,5 @@ var b = types.builders; | ||
*/ | ||
function compile(source) { | ||
function compile(source, mapOptions) { | ||
mapOptions = mapOptions || {}; | ||
var recastOptions = { | ||
@@ -377,3 +379,6 @@ tabWidth: guessTabWidth(source), | ||
// instead of the master branch that recast provides. | ||
esprima: esprimaHarmony | ||
esprima: esprimaHarmony, | ||
sourceFileName: mapOptions.sourceFileName, | ||
sourceMapName: mapOptions.sourceMapName | ||
}; | ||
@@ -391,3 +396,3 @@ | ||
function end () { | ||
this.queue(module.exports.compile(data)); | ||
this.queue(module.exports.compile(data).code); | ||
this.queue(null); | ||
@@ -394,0 +399,0 @@ } |
{ | ||
"name": "es6-class", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "ES6 classes compiled to ES5.", | ||
@@ -16,4 +16,3 @@ "main": "lib/index.js", | ||
"esprima": "git://github.com/ariya/esprima.git#harmony", | ||
"ast-types": "~0.3.10", | ||
"recast": "~0.4.24", | ||
"recast": "^0.5.13", | ||
"through": "~2.3.4" | ||
@@ -20,0 +19,0 @@ }, |
@@ -96,2 +96,8 @@ # es6-class | ||
To run specific example files: | ||
``` | ||
$ node test/runner test/examples/my_example.js test/examples/other_example.js | ||
``` | ||
### Pull Requests | ||
@@ -98,0 +104,0 @@ |
@@ -71,3 +71,3 @@ /** | ||
try { | ||
vm.runInNewContext(compile(source), { assert: assert }); | ||
vm.runInNewContext(compile(source).code, { assert: assert }); | ||
printSuccess(basename); | ||
@@ -93,5 +93,8 @@ callback(true); | ||
glob(path.join(__dirname, 'examples/*.js'), function(err, filenames) { | ||
if (err) { throw err; } | ||
/** | ||
* Runs the given test files and exits with the appropriate status code. | ||
* | ||
* @param {Array.<string>} filenames | ||
*/ | ||
function run(filenames) { | ||
var passed = []; | ||
@@ -119,2 +122,13 @@ var failed = []; | ||
next(); | ||
}); | ||
} | ||
var files = process.argv.slice(2); | ||
if (files.length) { | ||
run(files); | ||
} else { | ||
glob(path.join(__dirname, 'examples/*.js'), function(err, files) { | ||
if (err) { throw err; } | ||
run(files); | ||
}); | ||
} |
@@ -38,3 +38,3 @@ /** | ||
function normalize(source) { | ||
return recast.prettyPrint(recast.parse(source, recastOptions), recastOptions); | ||
return recast.prettyPrint(recast.parse(source, recastOptions), recastOptions).code; | ||
} | ||
@@ -41,0 +41,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27179
3
23
760
119
+ Addedamdefine@1.0.1(transitive)
+ Addedrecast@0.5.27(transitive)
+ Addedsource-map@0.1.32(transitive)
- Removedast-types@~0.3.10
- Removedasync@3.2.6(transitive)
- Removedesprima@4.0.1(transitive)
- Removedrecast@0.4.25(transitive)
- Removedsprintf@0.1.5(transitive)
- Removedunderscore@1.13.7(transitive)
- Removedwhiskey@0.6.13(transitive)
Updatedrecast@^0.5.13