Comparing version 0.8.5-1 to 0.9.0-0
100
Gruntfile.js
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var astPasses = require("./ast_passes.js"); | ||
@@ -251,2 +252,12 @@ var cc = require("closure-compiler"); | ||
String.prototype.contains = function String$contains( str ) { | ||
return this.indexOf( str ) >= 0; | ||
}; | ||
function isSlowTest( file ) { | ||
return file.contains("2.3.3") || | ||
file.contains("bind") || | ||
file.contains("unhandled_rejections"); | ||
} | ||
function testRun( testOption ) { | ||
@@ -299,60 +310,35 @@ var fs = require("fs"); | ||
var maxParallelProcesses = 10; | ||
var len = Math.min( files.length, maxParallelProcesses ); | ||
for( var i = 0; i < len; ++i ) { | ||
(function arguments$callee(file) { | ||
totalTests++; | ||
grunt.log.writeln("Running test " + file ); | ||
var env = undefined; | ||
if (file.indexOf("bluebird-debug-env-flag") >= 0) { | ||
env = Object.create(process.env); | ||
env["BLUEBIRD_DEBUG"] = true; | ||
} | ||
runIndependentTest(file, function(err) { | ||
if( err ) throw new Error(err + " " + file + " failed"); | ||
grunt.log.writeln("Test " + file + " succeeded"); | ||
testDone(); | ||
if( files.length > 0 ) { | ||
arguments$callee( files.shift() ); | ||
} | ||
}, env); | ||
})(files[i]); | ||
} | ||
} | ||
function benchmarkRun( benchmarkOption ) { | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
var done = this.async(); | ||
var files = benchmarkOption === "all" | ||
? fs.readdirSync('benchmark') | ||
: [benchmarkOption + ".js"]; | ||
files = files.filter(function( fileName ){ | ||
return /\.js$/.test(fileName); | ||
}).map(function(fileName){ | ||
return "./" + path.join( "benchmark", fileName ); | ||
var slowTests = files.filter(isSlowTest); | ||
files = files.filter(function(file){ | ||
return !isSlowTest(file); | ||
}); | ||
(function runner(files, i){ | ||
if( i >= files.length ) { | ||
done(); | ||
function runFile(file) { | ||
totalTests++; | ||
grunt.log.writeln("Running test " + file ); | ||
var env = undefined; | ||
if (file.indexOf("bluebird-debug-env-flag") >= 0) { | ||
env = Object.create(process.env); | ||
env["BLUEBIRD_DEBUG"] = true; | ||
} | ||
else { | ||
var file = files[i]; | ||
grunt.log.writeln("Running benchmark " + file ); | ||
if( file.indexOf( "matcha" ) !== -1 ) { | ||
grunt.log.writeln("Run matcha benchmarks with match"); | ||
runner(files, i + 1 ); | ||
runIndependentTest(file, function(err) { | ||
if( err ) throw new Error(err + " " + file + " failed"); | ||
grunt.log.writeln("Test " + file + " succeeded"); | ||
testDone(); | ||
if( files.length > 0 ) { | ||
runFile( files.shift() ); | ||
} | ||
else { | ||
require(file)(function(){ | ||
runner(files, i + 1 ); | ||
}); | ||
} | ||
} | ||
})(files, 0); | ||
}, env); | ||
} | ||
slowTests.forEach(runFile); | ||
var maxParallelProcesses = 10; | ||
var len = Math.min( files.length, maxParallelProcesses ); | ||
for( var i = 0; i < len; ++i ) { | ||
runFile(files[i]); | ||
} | ||
} | ||
grunt.registerTask( "build-with-minify", function() { | ||
@@ -378,14 +364,2 @@ return build.call( this, true ); | ||
grunt.registerTask( "benchrun", function(){ | ||
var benchmarkOption = grunt.option("run"); | ||
if( !benchmarkOption ) benchmarkOption = "all"; | ||
else { | ||
benchmarkOption = benchmarkOption | ||
.replace( /\.js$/, "" ) | ||
.replace( /[^a-zA-Z0-9_-]/g, "" ); | ||
} | ||
benchmarkRun.call( this, benchmarkOption ); | ||
}); | ||
grunt.registerTask( "bench", ["concat", "build", "jshint", "benchrun"] ); | ||
grunt.registerTask( "test", ["concat", "build", "jshint", "testrun"] ); | ||
@@ -392,0 +366,0 @@ grunt.registerTask( "default", ["concat", "build", "jshint"] ); |
{ | ||
"name": "bluebird", | ||
"description": "Full featured Promises/A+ implementation with exceptionally good performance", | ||
"version": "0.8.5-1", | ||
"version": "0.9.0-0", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "promise", |
@@ -23,4 +23,16 @@ <a href="http://promisesaplus.com/"> | ||
[API Reference and examples](https://github.com/petkaantonov/bluebird/blob/master/API.md) | ||
#Topics | ||
- [Quick start](#quick-start) | ||
- [API Reference and examples](https://github.com/petkaantonov/bluebird/blob/master/API.md) | ||
- [What are promises and why should I use them?](#what-are-promises-and-why-should-i-use-them) | ||
- [Error handling](#error-handling) | ||
- [Development](#development) | ||
- [Testing](#testing) | ||
- [Benchmarking](#benchmarks) | ||
- [What is the sync build?](#what-is-the-sync-build) | ||
- [License](#license) | ||
- [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets) | ||
- [Changelog](https://github.com/petkaantonov/bluebird/blob/master/changelog.md) | ||
#Quick start | ||
@@ -27,0 +39,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
259847
9
5974
311
5