diff --git a/lodash.js b/lodash.js index 8f3552b25..34bfd9a63 100644 --- a/lodash.js +++ b/lodash.js @@ -14526,7 +14526,7 @@ if (isArray(value)) { return arrayMap(value, baseCastKey); } - return isSymbol(value) ? [value] : stringToPath(value); + return isSymbol(value) ? [value] : copyArray(stringToPath(value)); } /** diff --git a/test/test.js b/test/test.js index 42f663c81..45dced171 100644 --- a/test/test.js +++ b/test/test.js @@ -22108,6 +22108,12 @@ }); }); + QUnit.test('should a new path array', function(assert) { + assert.expect(1); + + assert.notStrictEqual(_.toPath('a.b.c'), _.toPath('a.b.c')); + }); + QUnit.test('should not coerce symbols to strings', function(assert) { assert.expect(4);