Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixing global leaks #5

Open
wants to merge 1 commit into from

1 participant

@blmarket

Hi,

I'm trying to use alleup in my own projects, but it fails to pass mocha because of global leaks.

below is commit log which describes what I fixed. I can make other pull request if you wanna some testing suites.

i will be happy if you accept this pull requests. thanks for nice program you wrote!


it should use var for iterating variables

but it still has leaks reside in imagemagick.

@blmarket blmarket Fix global leaks
it should use var for iterating variables

but it still has leaks reside in imagemagick
9664a9b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 2, 2012
  1. @blmarket

    Fix global leaks

    blmarket authored
    it should use var for iterating variables
    
    but it still has leaks reside in imagemagick
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/alleup.js
View
14 lib/alleup.js
@@ -21,7 +21,7 @@ var Alleup = exports = module.exports = function Alleup(options) {
if ( typeof (config['storage']['aws'] || config['storage']['dir']) == 'undefined' )
throw new TypeError("No storage defined in alleup config");
- for(storage in config['storage']) {
+ for(var storage in config['storage']) {
eval('this.' + storage + 'Setup')(config['storage'][storage]);
}
@@ -57,13 +57,13 @@ Alleup.prototype = {
var _resize = _variants['resize'];
var _crop = _variants['crop'];
- for(version in _resize) {
+ for(var version in _resize) {
eval('this.' + storage_type + 'Remove')( this.genFileName( file, version ), function(err) {
callback(err);
});
};
- for(version in _crop) {
+ for(var version in _crop) {
eval('this.' + storage_type + 'Remove')( this.genFileName( file, version ), function(err) {
callback(err);
});
@@ -146,13 +146,13 @@ Alleup.prototype = {
new_file += ext;
var i = 0;
- for(prefix in _resize) {
+ for(var prefix in _resize) {
this.imAction('im.resize', file, this.genFileName( new_file, prefix ) , _resize[prefix], function(err){
i++;
if (i == Object.keys(_resize).length ) {
i = 0;
- for(prefix in _crop) {
+ for(var prefix in _crop) {
_this.imAction('im.crop', file, _this.genFileName( new_file, prefix ) , _crop[prefix], function(err){
i++;
if (i == Object.keys(_crop).length ) {
@@ -247,7 +247,7 @@ Alleup.prototype = {
imOptions: function(file, tfile, size) {
var _size = size.split('x');
- return options = {
+ return {
srcPath: file['path'],
dstPath: tfile,
width: _size[0],
@@ -256,4 +256,4 @@ Alleup.prototype = {
};
}
-};
+};
Something went wrong with that request. Please try again.