Comparing version 1.0.6 to 1.0.7
@@ -0,1 +1,8 @@ | ||
### [1.0.7](https://github.com/power-assert-js/espower/releases/tag/v1.0.7) (2015-09-21) | ||
* update escodegen to 1.7.0 ([feb96b0](https://github.com/power-assert-js/espower/commit/feb96b004acd0c540ab76a2529d91582b2095433)) | ||
* update source-map to 0.5.0 ([7bc824b](https://github.com/power-assert-js/espower/commit/7bc824ba9d808be7d25959822acceb9e04422373)) | ||
### [1.0.6](https://github.com/power-assert-js/espower/releases/tag/v1.0.6) (2015-06-07) | ||
@@ -2,0 +9,0 @@ |
@@ -26,5 +26,23 @@ var gulp = require('gulp'); | ||
}, | ||
assert_bundle: { | ||
standalone: 'assert', | ||
srcFile: './node_modules/assert/assert.js', | ||
destDir: './build', | ||
destName: 'assert.js' | ||
}, | ||
escodegen_bundle: { | ||
standalone: 'escodegen', | ||
srcFile: './node_modules/escodegen/escodegen.js', | ||
destDir: './build', | ||
destName: 'escodegen.js' | ||
}, | ||
estraverse_bundle: { | ||
standalone: 'estraverse', | ||
srcFile: './node_modules/estraverse/estraverse.js', | ||
destDir: './build', | ||
destName: 'estraverse.js' | ||
}, | ||
source_map_bundle: { | ||
standalone: 'sourceMap', | ||
srcFile: './node_modules/source-map/lib/source-map.js', | ||
srcFile: './node_modules/source-map/source-map.js', | ||
destDir: './build', | ||
@@ -43,3 +61,5 @@ destName: 'source-map.js' | ||
}; | ||
var BUILDS = ['assert', 'escodegen', 'estraverse', 'source_map']; | ||
function captureStdout (filespec) { | ||
@@ -114,4 +134,4 @@ var orig, log = ''; | ||
gulp.task('clean_bundle', function (done) { | ||
del([path.join(config.bundle.destDir, config.bundle.destName)], done); | ||
gulp.task('clean_bundle', function () { | ||
del.sync([path.join(config.bundle.destDir, config.bundle.destName)]); | ||
}); | ||
@@ -130,13 +150,17 @@ | ||
gulp.task('clean_source_map_bundle', function (done) { | ||
del([path.join(config.source_map_bundle.destDir, config.source_map_bundle.destName)], done); | ||
}); | ||
BUILDS.forEach(function (name) { | ||
gulp.task('clean_' + name + '_bundle', function () { | ||
del.sync([path.join(config[name + '_bundle'].destDir, config[name + '_bundle'].destName)]); | ||
}); | ||
gulp.task('source_map_bundle', ['clean_source_map_bundle'], function() { | ||
var bundleStream = browserify({entries: config.source_map_bundle.srcFile, standalone: config.source_map_bundle.standalone}).bundle(); | ||
return bundleStream | ||
.pipe(source(config.source_map_bundle.destName)) | ||
.pipe(derequire()) | ||
.pipe(gulp.dest(config.source_map_bundle.destDir)); | ||
gulp.task(name + '_bundle', ['clean_' + name + '_bundle'], function() { | ||
var bundleStream = browserify({entries: config[name + '_bundle'].srcFile, standalone: config[name + '_bundle'].standalone}).bundle(); | ||
return bundleStream | ||
.pipe(source(config[name + '_bundle'].destName)) | ||
.pipe(derequire()) | ||
.pipe(gulp.dest(config[name + '_bundle'].destDir)); | ||
}); | ||
}); | ||
gulp.task('clean_deps', BUILDS.map(function (name) { return 'clean_' + name + '_bundle'; })); | ||
gulp.task('build_deps', BUILDS.map(function (name) { return name + '_bundle'; })); | ||
@@ -147,4 +171,4 @@ gulp.task('unit', function () { | ||
gulp.task('clean_coverage', function (done) { | ||
del([config.coverage.filename], done); | ||
gulp.task('clean_coverage', function () { | ||
del.sync([config.coverage.filename]); | ||
}); | ||
@@ -156,3 +180,3 @@ | ||
gulp.task('test_amd', ['source_map_bundle'], function () { | ||
gulp.task('test_amd', ['build_deps'], function () { | ||
return gulp | ||
@@ -163,3 +187,3 @@ .src(config.test.amd) | ||
gulp.task('test_browser', ['source_map_bundle'], function () { | ||
gulp.task('test_browser', ['build_deps'], function () { | ||
return gulp | ||
@@ -176,4 +200,4 @@ .src(config.test.browser) | ||
gulp.task('clean', ['clean_coverage', 'clean_bundle', 'clean_source_map_bundle']); | ||
gulp.task('clean', ['clean_coverage', 'clean_bundle', 'clean_deps']); | ||
gulp.task('test', ['unit','test_browser','test_amd']); |
@@ -31,7 +31,2 @@ 'use strict'; | ||
// see: https://github.com/Constellation/escodegen/issues/115 | ||
if (typeof define === 'function' && define.amd) { | ||
escodegen = window.escodegen; | ||
} | ||
function AssertionVisitor (matcher, assertionPath, options) { | ||
@@ -38,0 +33,0 @@ this.matcher = matcher; |
{ | ||
"name": "espower", | ||
"description": "Power Assert feature instrumentor based on the ECMAScript AST", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"author": { | ||
@@ -16,3 +16,3 @@ "name": "Takuto Wada", | ||
"escallmatch": "^1.4.2", | ||
"escodegen": "^1.6.1", | ||
"escodegen": "^1.7.0", | ||
"espurify": "^1.3.0", | ||
@@ -23,3 +23,3 @@ "estraverse": "^4.1.0", | ||
"path-is-absolute": "^1.0.0", | ||
"source-map": "^0.4.2", | ||
"source-map": "^0.5.0", | ||
"type-name": "^1.0.1", | ||
@@ -29,20 +29,21 @@ "xtend": "^4.0.0" | ||
"devDependencies": { | ||
"acorn": "^1.2.2", | ||
"amdefine": "^0.1.0", | ||
"acorn": "^2.4.0", | ||
"amdefine": "^1.0.0", | ||
"assert": "^1.3.0", | ||
"blanket": "^1.1.7", | ||
"browserify": "^10.2.3", | ||
"del": "^1.2.0", | ||
"browserify": "^11.1.0", | ||
"del": "^2.0.2", | ||
"gulp": "^3.9.0", | ||
"gulp-derequire": "^2.1.0", | ||
"gulp-dereserve": "^0.2.0", | ||
"gulp-jshint": "^1.11.0", | ||
"gulp-mocha": "^2.1.1", | ||
"gulp-mocha-phantomjs": "^0.6.1", | ||
"gulp-util": "^3.0.5", | ||
"gulp-dereserve": "^0.2.1", | ||
"gulp-jshint": "^1.11.2", | ||
"gulp-mocha": "^2.1.3", | ||
"gulp-mocha-phantomjs": "^0.10.1", | ||
"gulp-util": "^3.0.6", | ||
"gulp-webserver": "^0.9.1", | ||
"jshint-stylish": "^2.0.0", | ||
"licensify": "^1.1.0", | ||
"mocha": "^2.2.5", | ||
"jshint-stylish": "^2.0.1", | ||
"licensify": "^2.0.1", | ||
"mocha": "^2.3.2", | ||
"mocha-lcov-reporter": "^0.0.2", | ||
"through2": "^1.1.1", | ||
"through2": "^2.0.0", | ||
"vinyl-source-stream": "^1.1.0" | ||
@@ -49,0 +50,0 @@ }, |
@@ -191,3 +191,3 @@ espower | ||
var jsAst = esprima.parse(fs.readFileSync(filepath), {tolerant: true, loc: true, tokens: true}); | ||
var modifiedAst = espower(jsAst, {path: filepath}); | ||
var modifiedAst = espower(jsAst, {path: filepath, sourceRoot: __dirname}); | ||
@@ -205,3 +205,3 @@ console.log(escodegen.generate(modifiedAst)); | ||
content: 'assert(falsy)', | ||
filepath: '/path/to/example_test.js', | ||
filepath: 'example_test.js', | ||
line: 4 | ||
@@ -211,7 +211,7 @@ })); | ||
content: 'assert.equal(truthy, falsy)', | ||
filepath: '/path/to/example_test.js', | ||
filepath: 'example_test.js', | ||
line: 5 | ||
}), assert._expr(assert._capt(falsy, 'arguments/1'), { | ||
content: 'assert.equal(truthy, falsy)', | ||
filepath: '/path/to/example_test.js', | ||
filepath: 'example_test.js', | ||
line: 5 | ||
@@ -218,0 +218,0 @@ })); |
@@ -21,11 +21,2 @@ (function (root, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
// see: https://github.com/Constellation/escodegen/issues/115 | ||
escodegen = window.escodegen; | ||
// TypeError: 'undefined' is not an object (evaluating 'global.sourceMap.SourceNode') | ||
// at generate (bower_components/escodegen/escodegen.browser.js:1845) | ||
window.sourceMap = sourceMap; | ||
} | ||
function instrument (jsCode, options) { | ||
@@ -32,0 +23,0 @@ var jsAST = acorn.parse(jsCode, {ecmaVersion: 6, locations: true}); |
@@ -17,7 +17,2 @@ (function (root, factory) { | ||
// see: https://github.com/Constellation/escodegen/issues/115 | ||
if (typeof define === 'function' && define.amd) { | ||
escodegen = window.escodegen; | ||
} | ||
describe('instrumentation spec', function () { | ||
@@ -124,2 +119,5 @@ function testWithParserOptions (jsCode, expected, options) { | ||
"assert(assert._expr(assert._capt(assert._capt(assert._capt(ary1,'arguments/0/left/object').length,'arguments/0/left')===assert._capt(assert._capt(ary2,'arguments/0/right/object').length,'arguments/0/right'),'arguments/0'),{content:'assert(ary1.length === ary2.length)',filepath:'path/to/some_test.js',line:1}));"); | ||
inst("assert(foo instanceof Foo);", | ||
"assert(assert._expr(assert._capt(assert._capt(foo,'arguments/0/left')instanceof assert._capt(Foo,'arguments/0/right'),'arguments/0'),{content:'assert(foo instanceof Foo)',filepath:'path/to/some_test.js',line:1}));"); | ||
}); | ||
@@ -336,6 +334,6 @@ | ||
inst("assert(fuga !== 'ふが');", | ||
"assert(assert._expr(assert._capt(assert._capt(fuga,'arguments/0/left')!=='\\u3075\\u304C','arguments/0'),{content:'assert(fuga !== \\'\\u3075\\u304C\\')',filepath:'path/to/some_test.js',line:1}));"); | ||
"assert(assert._expr(assert._capt(assert._capt(fuga,'arguments/0/left')!=='ふが','arguments/0'),{content:'assert(fuga !== \\'ふが\\')',filepath:'path/to/some_test.js',line:1}));"); | ||
inst("assert('ほげ' !== 'ふが');", | ||
"assert(assert._expr(assert._capt('\\u307B\\u3052'!=='\\u3075\\u304C','arguments/0'),{content:'assert(\\'\\u307B\\u3052\\' !== \\'\\u3075\\u304C\\')',filepath:'path/to/some_test.js',line:1}));"); | ||
"assert(assert._expr(assert._capt('ほげ'!=='ふが','arguments/0'),{content:'assert(\\'ほげ\\' !== \\'ふが\\')',filepath:'path/to/some_test.js',line:1}));"); | ||
}); | ||
@@ -342,0 +340,0 @@ |
var require = { | ||
paths: { | ||
espower: '../build/espower', | ||
assert: '../bower_components/assert/assert', | ||
escodegen: '../bower_components/escodegen/escodegen.browser', | ||
assert: '../build/assert', | ||
escodegen: '../build/escodegen', | ||
acorn: '../node_modules/acorn/dist/acorn', | ||
estraverse: '../bower_components/estraverse/estraverse', | ||
estraverse: '../build/estraverse', | ||
"source-map": '../build/source-map', | ||
mocha: '../bower_components/mocha/mocha', | ||
requirejs: '../bower_components/requirejs/require' | ||
}, | ||
shim: { | ||
assert: { | ||
exports: 'assert' | ||
}, | ||
escodegen: { | ||
exports: 'escodegen' | ||
} | ||
} | ||
}; |
Sorry, the diff of this file is too big to display
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
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
814455
19448
3
20
+ Addedsource-map@0.5.7(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedsource-map@0.4.4(transitive)
Updatedescodegen@^1.7.0
Updatedsource-map@^0.5.0