fixed some bugs from the last commit
This commit is contained in:
		
							parent
							
								
									8745fd64ca
								
							
						
					
					
						commit
						7d4adf314d
					
				
							
								
								
									
										28
									
								
								gulpfile.js
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								gulpfile.js
									
									
									
									
									
								
							@ -54,12 +54,13 @@ var concat = require('gulp-concat')
 | 
				
			|||||||
var watch = require('gulp-watch')
 | 
					var watch = require('gulp-watch')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var options = minimist(process.argv.slice(2), {
 | 
					var options = minimist(process.argv.slice(2), {
 | 
				
			||||||
  string: ['export', 'name', 'testport', 'testfiles'],
 | 
					  string: ['export', 'name', 'testport', 'testfiles', 'regenerator'],
 | 
				
			||||||
  default: {
 | 
					  default: {
 | 
				
			||||||
    export: 'ignore',
 | 
					    export: 'ignore',
 | 
				
			||||||
    name: 'y.js',
 | 
					    name: 'y.js',
 | 
				
			||||||
    testport: '8888',
 | 
					    testport: '8888',
 | 
				
			||||||
    testfiles: 'src/**/*.js'
 | 
					    testfiles: 'src/**/*.js',
 | 
				
			||||||
 | 
					    regenerator: process.version < 'v0.12'
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -92,6 +93,10 @@ var files = {
 | 
				
			|||||||
  }).concat(['build/**/*.spec.js']))
 | 
					  }).concat(['build/**/*.spec.js']))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (options.regenerator) {
 | 
				
			||||||
 | 
					  files.test = polyfills.concat(files.test)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gulp.task('build:deploy', function () {
 | 
					gulp.task('build:deploy', function () {
 | 
				
			||||||
  gulp.src(files.src)
 | 
					  gulp.src(files.src)
 | 
				
			||||||
    .pipe(sourcemaps.init())
 | 
					    .pipe(sourcemaps.init())
 | 
				
			||||||
@ -107,14 +112,17 @@ gulp.task('build:deploy', function () {
 | 
				
			|||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gulp.task('build:test', function () {
 | 
					gulp.task('build:test', function () {
 | 
				
			||||||
  gulp.src('src/**/*.js')
 | 
					  var babelOptions = {
 | 
				
			||||||
    .pipe(sourcemaps.init())
 | 
					 | 
				
			||||||
    .pipe(babel({
 | 
					 | 
				
			||||||
    loose: 'all',
 | 
					    loose: 'all',
 | 
				
			||||||
    modules: 'ignore',
 | 
					    modules: 'ignore',
 | 
				
			||||||
      blacklist: 'regenerator',
 | 
					 | 
				
			||||||
    experimental: true
 | 
					    experimental: true
 | 
				
			||||||
    }))
 | 
					  }
 | 
				
			||||||
 | 
					  if (!options.regenerator) {
 | 
				
			||||||
 | 
					    babelOptions.blacklist = 'regenerator'
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  gulp.src('src/**/*.js')
 | 
				
			||||||
 | 
					    .pipe(sourcemaps.init())
 | 
				
			||||||
 | 
					    .pipe(babel(babelOptions))
 | 
				
			||||||
    .pipe(sourcemaps.write())
 | 
					    .pipe(sourcemaps.write())
 | 
				
			||||||
    .pipe(gulp.dest('build'))
 | 
					    .pipe(gulp.dest('build'))
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@ -138,7 +146,11 @@ gulp.task('dev', ['build:test'], function () {
 | 
				
			|||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gulp.task('test', ['build:test'], function () {
 | 
					gulp.task('test', ['build:test'], function () {
 | 
				
			||||||
  return gulp.src(files.test)
 | 
					  var testfiles = files.test
 | 
				
			||||||
 | 
					  if (typeof Promise === 'undefined') {
 | 
				
			||||||
 | 
					    testfiles = ['./node_modules/promise-polyfill/Promise.js'].concat(testfiles)
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return gulp.src(testfiles)
 | 
				
			||||||
    .pipe(jasmine({
 | 
					    .pipe(jasmine({
 | 
				
			||||||
      verbose: true,
 | 
					      verbose: true,
 | 
				
			||||||
      includeStuckTrace: true
 | 
					      includeStuckTrace: true
 | 
				
			||||||
 | 
				
			|||||||
@ -53,6 +53,7 @@
 | 
				
			|||||||
    "gulp-watch": "^4.3.5",
 | 
					    "gulp-watch": "^4.3.5",
 | 
				
			||||||
    "minimist": "^1.2.0",
 | 
					    "minimist": "^1.2.0",
 | 
				
			||||||
    "pre-commit": "^1.1.1",
 | 
					    "pre-commit": "^1.1.1",
 | 
				
			||||||
 | 
					    "promise-polyfill": "^2.1.0",
 | 
				
			||||||
    "standard": "^5.2.2"
 | 
					    "standard": "^5.2.2"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -298,7 +298,7 @@ class AbstractOperationStore {
 | 
				
			|||||||
      op.deleted === true &&
 | 
					      op.deleted === true &&
 | 
				
			||||||
      this.y.connector.isSynced &&
 | 
					      this.y.connector.isSynced &&
 | 
				
			||||||
      left != null &&
 | 
					      left != null &&
 | 
				
			||||||
      left.deleted &&
 | 
					      left.deleted
 | 
				
			||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
      op.gc = true
 | 
					      op.gc = true
 | 
				
			||||||
      this.gc1.push(op.id)
 | 
					      this.gc1.push(op.id)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user