Skip to content

Commit d6ba0da

Browse files
committed
Renamed mergeObjectsWithNoDuplicateKeys to mergeIntoWithNoDuplicateKeys.
1 parent a26fe5a commit d6ba0da

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/core/ReactCompositeComponent.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,17 +604,17 @@ function mixStaticSpecIntoComponent(Constructor, statics) {
604604
* @param {object} two The second object
605605
* @return {object} one after it has been mutated to contain everything in two.
606606
*/
607-
function mergeObjectsWithNoDuplicateKeys(one, two) {
607+
function mergeIntoWithNoDuplicateKeys(one, two) {
608608
invariant(
609609
one && two && typeof one === 'object' && typeof two === 'object',
610-
'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects'
610+
'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
611611
);
612612

613613
for (var key in two) {
614614
if (two.hasOwnProperty(key)) {
615615
invariant(
616616
one[key] === undefined,
617-
'mergeObjectsWithNoDuplicateKeys(): ' +
617+
'mergeIntoWithNoDuplicateKeys(): ' +
618618
'Tried to merge two objects with the same key: `%s`. This conflict ' +
619619
'may be due to a mixin; in particular, this may be caused by two ' +
620620
'getInitialState() or getDefaultProps() methods returning objects ' +
@@ -645,8 +645,8 @@ function createMergedResultFunction(one, two) {
645645
return a;
646646
}
647647
var c = {};
648-
mergeObjectsWithNoDuplicateKeys(c, a);
649-
mergeObjectsWithNoDuplicateKeys(c, b);
648+
mergeIntoWithNoDuplicateKeys(c, a);
649+
mergeIntoWithNoDuplicateKeys(c, b);
650650
return c;
651651
};
652652
}

src/core/__tests__/ReactCompositeComponent-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ describe('ReactCompositeComponent', function() {
680680
expect(function() {
681681
instance = ReactTestUtils.renderIntoDocument(instance);
682682
}).toThrow(
683-
'Invariant Violation: mergeObjectsWithNoDuplicateKeys(): ' +
683+
'Invariant Violation: mergeIntoWithNoDuplicateKeys(): ' +
684684
'Tried to merge two objects with the same key: `x`. This conflict ' +
685685
'may be due to a mixin; in particular, this may be caused by two ' +
686686
'getInitialState() or getDefaultProps() methods returning objects ' +

0 commit comments

Comments
 (0)