Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
8a9938ce
...
8a9938ce033b81f2f218bbe7f8b13551847d158f
authored
2013-02-01 17:35:49 +0100
by
Thomas Rosenau
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed incorrect merging algorithm; did not deep-clone when merging into empty object
1 parent
27440007
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
modules/utils.js
modules/utils.js
View file @
8a9938c
...
...
@@ -533,13 +533,13 @@ exports.isWebPage = isWebPage;
function
mergeObjects
(
origin
,
add
)
{
"use strict"
;
for
(
var
p
in
add
)
{
try
{
if
(
add
[
p
].
constructor
===
Object
)
{
if
(
origin
.
hasOwnProperty
(
p
)
&&
origin
[
p
].
constructor
===
Object
)
{
origin
[
p
]
=
mergeObjects
(
origin
[
p
],
add
[
p
]);
}
else
{
origin
[
p
]
=
add
[
p
]
;
origin
[
p
]
=
clone
(
add
[
p
])
;
}
}
catch
(
e
)
{
}
else
{
origin
[
p
]
=
add
[
p
];
}
}
...
...
Please
register
or
sign in
to post a comment