Skip to content
Snippets Groups Projects
Commit 7d4adf31 authored by DadaMonad's avatar DadaMonad
Browse files

fixed some bugs from the last commit

parent 8745fd64
No related branches found
No related tags found
No related merge requests found
...@@ -54,12 +54,13 @@ var concat = require('gulp-concat') ...@@ -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 = { ...@@ -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 () { ...@@ -107,14 +112,17 @@ gulp.task('build:deploy', function () {
}) })
gulp.task('build:test', function () { gulp.task('build:test', function () {
var babelOptions = {
loose: 'all',
modules: 'ignore',
experimental: true
}
if (!options.regenerator) {
babelOptions.blacklist = 'regenerator'
}
gulp.src('src/**/*.js') gulp.src('src/**/*.js')
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(babel({ .pipe(babel(babelOptions))
loose: 'all',
modules: 'ignore',
blacklist: 'regenerator',
experimental: true
}))
.pipe(sourcemaps.write()) .pipe(sourcemaps.write())
.pipe(gulp.dest('build')) .pipe(gulp.dest('build'))
}) })
...@@ -138,7 +146,11 @@ gulp.task('dev', ['build:test'], function () { ...@@ -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 @@ ...@@ -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 { ...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment