diff --git a/History.md b/History.md index 424ad44a93..b177e1127c 100644 --- a/History.md +++ b/History.md @@ -13,6 +13,8 @@ The complete list can be found [here](https://github.com/meteor/ecmascript-runtime/blob/master/server.js). +* Check type of `onException` argument to `bindEnvironment`. #5271 + ## v1.2.0.2, 2015-Sept-28 * Update Crosswalk plugin for Cordova to 1.3.1. [#5267](https://github.com/meteor/meteor/issues/5267) diff --git a/packages/meteor/dynamics_nodejs.js b/packages/meteor/dynamics_nodejs.js index 87156cb56c..1037be8e38 100644 --- a/packages/meteor/dynamics_nodejs.js +++ b/packages/meteor/dynamics_nodejs.js @@ -94,6 +94,8 @@ Meteor.bindEnvironment = function (func, onException, _this) { error && error.stack || error ); }; + } else if (typeof(onException) !== 'function') { + throw new Error('onException argument must be a function, string or undefined for Meteor.bindEnvironment().'); } return function (/* arguments */) {