Skip to content

Commit

Permalink
Update gulp to the latest version 🚀 (#138)
Browse files Browse the repository at this point in the history
* chore(package): update gulp to version 4.0.0

* [update] adds gulp api updates

* [update] ensure e, data, value are assigned w/in ParentAPI
  • Loading branch information
greenkeeper[bot] authored and yowainwright committed Dec 11, 2018
1 parent f7d5e0c commit 3026a7e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Gulpfile.js
Expand Up @@ -5,8 +5,8 @@ const mochaPhantomJS = require('gulp-mocha-phantomjs')
const path = require('path')
const serveStatic = require('serve-static')

let parentServer
let childServer
let parentServer
let childServer

gulp.task('parent-test-server', (done) => {
parentServer = http
Expand Down Expand Up @@ -39,7 +39,10 @@ gulp.task('do-test', () => {
return stream
})

gulp.task('test', ['parent-test-server', 'child-test-server', 'do-test'], () => {
gulp.task('finish-test', (done) => {
parentServer.close()
childServer.close()
done()
})

gulp.task('test', gulp.series('parent-test-server', 'child-test-server', 'do-test', 'finish-test'))
2 changes: 2 additions & 0 deletions build/postmate.dev.js
Expand Up @@ -119,6 +119,8 @@
}

this.listener = function (e) {
if (!sanitize(e, _this.childOrigin)) return false;

var _ref = ((e || {}).data || {}).value || {},
data = _ref.data,
name = _ref.name;
Expand Down
2 changes: 2 additions & 0 deletions build/postmate.es.js
Expand Up @@ -113,6 +113,8 @@ function () {
}

this.listener = function (e) {
if (!sanitize(e, _this.childOrigin)) return false;

var _ref = ((e || {}).data || {}).value || {},
data = _ref.data,
name = _ref.name;
Expand Down
2 changes: 2 additions & 0 deletions build/postmate.js
Expand Up @@ -115,6 +115,8 @@ function () {
}

this.listener = function (e) {
if (!sanitize(e, _this.childOrigin)) return false;

var _ref = ((e || {}).data || {}).value || {},
data = _ref.data,
name = _ref.name;
Expand Down
2 changes: 1 addition & 1 deletion build/postmate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"es-check": "^5.0.0",
"eslint": "^5.0.0",
"eslint-config-dollarshaveclub": "^3.0.4",
"gulp": "3.9.1",
"gulp": "4.0.0",
"gulp-mocha-phantomjs": "0.12.2",
"gzip-size": "^5.0.0",
"jest": "^22.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/postmate.js
Expand Up @@ -104,7 +104,10 @@ export class ParentAPI {
this.listener = (e) => {
if (!sanitize(e, this.childOrigin)) return false

const { data, name } = e.data.value
/**
* the assignments below ensures that e, data, and value are all defined
*/
const { data, name } = (((e || {}).data || {}).value || {})

if (e.data.postmate === 'emit') {
if (process.env.NODE_ENV !== 'production') {
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/runner.html
Expand Up @@ -11,7 +11,7 @@
<script src="../../node_modules/chai/chai.js"></script>
<script>mocha.setup('bdd')</script>
<script src="../../node_modules/rsvp/dist/rsvp.min.js"></script>
<script src="../../build/postmate.min.js"></script>
<script src="../../build/postmate.dev.js"></script>
<script>Postmate.Promise = RSVP.Promise;</script>
<script src="./test.js"></script>
<div id="frame"></div>
Expand Down

0 comments on commit 3026a7e

Please sign in to comment.