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
258d66d0
...
258d66d08aadf212ee66cf2168e32b949e359967
authored
2013-10-06 17:18:06 -0700
by
Matt DuVall
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Doc updates and lint fixes
1 parent
93c3c106
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
11 deletions
docs/modules/utils.rst
modules/utils.js
tests/suites/utils.js
docs/modules/utils.rst
View file @
258d66d
...
...
@@ -220,7 +220,7 @@ Checks if passed argument is an instance of native PhantomJS' ``WebPage`` object
Merges two objects recursively.
Add
opts.keepReferences
if cloning of internal objects is not needed.
Add
``opts.keepReferences``
if cloning of internal objects is not needed.
.. index:: DOM
...
...
modules/utils.js
View file @
258d66d
...
...
@@ -641,11 +641,7 @@ function mergeObjectsInSlimerjs(origin, add, opts) {
if
(
isPlainObject
(
origin
[
p
]))
{
origin
[
p
]
=
mergeObjects
(
origin
[
p
],
add
[
p
]);
}
else
{
if
(
keepReferences
)
{
origin
[
p
]
=
add
[
p
];
}
else
{
origin
[
p
]
=
clone
(
add
[
p
]);
}
origin
[
p
]
=
keepReferences
?
add
[
p
]
:
clone
(
add
[
p
]);
}
}
else
{
origin
[
p
]
=
add
[
p
];
...
...
@@ -680,11 +676,7 @@ function mergeObjects(origin, add, opts) {
if
(
origin
[
p
]
&&
origin
[
p
].
constructor
===
Object
)
{
origin
[
p
]
=
mergeObjects
(
origin
[
p
],
add
[
p
]);
}
else
{
if
(
keepReferences
)
{
origin
[
p
]
=
add
[
p
];
}
else
{
origin
[
p
]
=
clone
(
add
[
p
]);
}
origin
[
p
]
=
keepReferences
?
add
[
p
]
:
clone
(
add
[
p
]);
}
}
else
{
origin
[
p
]
=
add
[
p
];
...
...
tests/suites/utils.js
View file @
258d66d
...
...
@@ -327,6 +327,7 @@ casper.test.begin('isJsFile() tests', 5, function(test) {
casper
.
test
.
begin
(
'mergeObjects() tests'
,
10
,
function
(
test
)
{
/* jshint eqeqeq:false */
var
testCases
=
[
{
obj1
:
{
a
:
1
},
obj2
:
{
b
:
2
},
merged
:
{
a
:
1
,
b
:
2
}
...
...
Please
register
or
sign in
to post a comment