From 7d4adf314d71cbdd475fb629d5434da53df8deb1 Mon Sep 17 00:00:00 2001 From: DadaMonad <kevin.jahns@rwth-aachen.de> Date: Fri, 2 Oct 2015 08:01:58 +0000 Subject: [PATCH] fixed some bugs from the last commit --- gulpfile.js | 30 +++++++++++++++++++++--------- package.json | 1 + src/OperationStore.js | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 5e02ceab..19c1100e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -54,12 +54,13 @@ var concat = require('gulp-concat') var watch = require('gulp-watch') var options = minimist(process.argv.slice(2), { - string: ['export', 'name', 'testport', 'testfiles'], + string: ['export', 'name', 'testport', 'testfiles', 'regenerator'], default: { export: 'ignore', name: 'y.js', testport: '8888', - testfiles: 'src/**/*.js' + testfiles: 'src/**/*.js', + regenerator: process.version < 'v0.12' } }) @@ -92,6 +93,10 @@ var files = { }).concat(['build/**/*.spec.js'])) } +if (options.regenerator) { + files.test = polyfills.concat(files.test) +} + gulp.task('build:deploy', function () { gulp.src(files.src) .pipe(sourcemaps.init()) @@ -107,14 +112,17 @@ gulp.task('build:deploy', function () { }) gulp.task('build:test', function () { + var babelOptions = { + loose: 'all', + modules: 'ignore', + experimental: true + } + if (!options.regenerator) { + babelOptions.blacklist = 'regenerator' + } gulp.src('src/**/*.js') .pipe(sourcemaps.init()) - .pipe(babel({ - loose: 'all', - modules: 'ignore', - blacklist: 'regenerator', - experimental: true - })) + .pipe(babel(babelOptions)) .pipe(sourcemaps.write()) .pipe(gulp.dest('build')) }) @@ -138,7 +146,11 @@ gulp.task('dev', ['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({ verbose: true, includeStuckTrace: true diff --git a/package.json b/package.json index 2f95ffb8..291dca7c 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "gulp-watch": "^4.3.5", "minimist": "^1.2.0", "pre-commit": "^1.1.1", + "promise-polyfill": "^2.1.0", "standard": "^5.2.2" } } diff --git a/src/OperationStore.js b/src/OperationStore.js index 37031f6a..8ddf4375 100644 --- a/src/OperationStore.js +++ b/src/OperationStore.js @@ -298,7 +298,7 @@ class AbstractOperationStore { op.deleted === true && this.y.connector.isSynced && left != null && - left.deleted && + left.deleted ) { op.gc = true this.gc1.push(op.id) -- GitLab