Skip to content

Commit

Permalink
Merge pull request #573 from oliviertassinari/master
Browse files Browse the repository at this point in the history
[ENV] replace process.NODE_ENV with process.env.NODE_ENV
  • Loading branch information
mmrtnz committed Apr 24, 2015
2 parents 79484b2 + 674e6bc commit fb775c9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/js/app-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var AppBar = React.createClass({
},

componentDidMount: function() {
if (process.NODE_ENV !== 'production' &&
if (process.env.NODE_ENV !== 'production' &&
(this.props.iconElementLeft && this.props.iconClassNameLeft)) {
var warning = 'Properties iconClassNameLeft and iconElementLeft cannot be simultaneously ' +
'defined. Please use one or the other.';
Expand Down
2 changes: 1 addition & 1 deletion src/js/drop-down-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var DropDownMenu = React.createClass({
_setSelectedIndex: function(props) {
var selectedIndex = props.selectedIndex;

if (process.NODE_ENV !== 'production' && selectedIndex < 0) {
if (process.env.NODE_ENV !== 'production' && selectedIndex < 0) {
console.warn('Cannot set selectedIndex to a negative index.', selectedIndex);
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/enhanced-switch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var EnhancedSwitch = React.createClass({
if (!this.props.hasOwnProperty('checked') || this.props.checked === false) {
this.setState({switched: newSwitchedValue});
React.findDOMNode(this.refs.checkbox).checked = newSwitchedValue;
} else if (process.NODE_ENV !== 'production') {
} else if (process.env.NODE_ENV !== 'production') {
var message = 'Cannot call set method while checked is defined as a property.';
console.error(message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/floating-action-button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var RaisedButton = React.createClass({
},

componentDidMount: function() {
if (process.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production') {
if (this.props.iconClassName && this.props.children) {
var warning = 'You have set both an iconClassName and a child icon. ' +
'It is recommended you use only one method when adding ' +
Expand Down
2 changes: 1 addition & 1 deletion src/js/icon-button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var IconButton = React.createClass({
if (this.props.tooltip) {
this._positionTooltip();
}
if (process.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production') {
if (this.props.iconClassName && this.props.children) {
var warning = 'You have set both an iconClassName and a child icon. ' +
'It is recommended you use only one method when adding ' +
Expand Down
2 changes: 1 addition & 1 deletion src/js/input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var Input = React.createClass({
},

componentDidMount: function() {
if (process.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production') {
console.warn('Input has been deprecated. Please use TextField instead. See http://material-ui.com/#/components/text-fields');
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/js/radio-button-group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ var RadioButtonGroup = React.createClass({
_updateRadioButtons: function(newSelection) {
if (this.state.numberCheckedRadioButtons == 0) {
this.setState({selected: newSelection});
} else if (process.NODE_ENV !== 'production') {
var message = "Cannot select a different radio button while another radio button " +
} else if (process.env.NODE_ENV !== 'production') {
var message = "Cannot select a different radio button while another radio button " +
"has the 'checked' property set to true.";
console.error(message);
}
Expand Down
4 changes: 2 additions & 2 deletions src/js/text-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ var TextField = React.createClass({
},

setErrorText: function(newErrorText) {
if (process.NODE_ENV !== 'production' && this.props.hasOwnProperty('errorText')) {
if (process.env.NODE_ENV !== 'production' && this.props.hasOwnProperty('errorText')) {
console.error('Cannot call TextField.setErrorText when errorText is defined as a property.');
} else if (this.isMounted()) {
this.setState({errorText: newErrorText});
}
},

setValue: function(newValue) {
if (process.NODE_ENV !== 'production' && this._isControlled()) {
if (process.env.NODE_ENV !== 'production' && this._isControlled()) {
console.error('Cannot call TextField.setValue when value or valueLink is defined as a property.');
} else if (this.isMounted()) {
this._getInputNode().value = newValue;
Expand Down

0 comments on commit fb775c9

Please sign in to comment.