Skip to content

Instantly share code, notes, and snippets.

@lamchau
Created November 17, 2014 04:40
Show Gist options
  • Save lamchau/835792a7cbd957e61fc1 to your computer and use it in GitHub Desktop.
Save lamchau/835792a7cbd957e61fc1 to your computer and use it in GitHub Desktop.
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
// });
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment