Merge pull request #2941 from kevinold/2870-update-warning-calls

Update warning calls to use %s #2870
This commit is contained in:
Jim 2015-01-26 22:06:42 -08:00
commit 61ee74b562
5 changed files with 24 additions and 12 deletions

View File

@ -51,8 +51,9 @@ if (__DEV__) {
warnedStyleNames[name] = true;
warning(
false,
'Unsupported style property ' + name + '. Did you mean ' +
camelizeStyleName(name) + '?'
'Unsupported style property %s. Did you mean %s?',
name,
camelizeStyleName(name)
);
};
@ -64,8 +65,9 @@ if (__DEV__) {
warnedStyleNames[name] = true;
warning(
false,
'Unsupported vendor-prefixed style property ' + name + '. Did you mean ' +
name.charAt(0).toUpperCase() + name.slice(1) + '?'
'Unsupported vendor-prefixed style property %s. Did you mean %s?',
name,
name.charAt(0).toUpperCase() + name.slice(1)
);
};

View File

@ -61,7 +61,9 @@ if (__DEV__) {
// logging too much when using transferPropsTo.
warning(
standardName == null,
'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
'Unknown DOM property %s. Did you mean %s?',
name,
standardName
);
};

View File

@ -45,8 +45,9 @@ function defineWarningProperty(object, key) {
set: function(value) {
warning(
false,
'Don\'t set the ' + key + ' property of the React element. Instead, ' +
'specify the correct value when initially creating the element.'
'Don\'t set the %s property of the React element. Instead, ' +
'specify the correct value when initially creating the element.',
key
);
this._store[key] = value;
}

View File

@ -306,9 +306,12 @@ function warnForPropsMutation(propName, element) {
warning(
false,
'Don\'t set .props.' + propName + ' of the React component' +
elementInfo + '. Instead, specify the correct value when ' +
'initially creating the element.' + ownerInfo
'Don\'t set .props.%s of the React component%s. ' +
'Instead, specify the correct value when ' +
'initially creating the element.%s',
propName,
elementInfo,
ownerInfo
);
}

View File

@ -31,8 +31,12 @@ function deprecated(namespace, oldName, newName, ctx, fn) {
var newFn = function() {
warning(
warned,
`${namespace}.${oldName} will be deprecated in a future version. ` +
`Use ${namespace}.${newName} instead.`
'%s.%s will be deprecated in a future version. ' +
'Use %s.%s instead.',
namespace,
oldName,
namespace,
newName
);
warned = true;
return fn.apply(ctx, arguments);