lamchau
11/17/2014 - 4:40 AM

Ember.js - Immutable check for production mode (FF4+, IE9+, Chrome 5+; modern browsers)

Ember.js - Immutable check for production mode (FF4+, IE9+, Chrome 5+; modern browsers)

if (!Ember.productionMode) {
  // relies on ember build tools which turn `Ember.assert` into a NOOP 
  Object.defineProperty(Ember, 'productionMode', {
    value: Ember.assert && Ember.assert.length == 0
  });
}

// more correct name name
// if (!Ember.assertionsEnabled) {
//   // relies on ember build tools which turn `Ember.assert` into a NOOP 
//   Object.defineProperty(Ember, 'assertionsEnabled', {
//     value: Ember.assert && Ember.assert.length
//   });
// }