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
75a6f921
...
75a6f921c9afa82793509cb3d17d3b972b494245
authored
2011-12-27 17:07:47 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
removed obsolete utils.replaceFunctionPlaceholders() function
1 parent
edbfbe38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
25 deletions
CHANGELOG
modules/utils.js
CHANGELOG
View file @
75a6f92
CasperJS Changelog
==================
XXXX-XX-XX, v0.6.0
-alpha
------------------
------
XXXX-XX-XX, v0.6.0
------------------
- BC BREAK: removed obsolete `replaceFunctionPlaceholders()`
- commonjs/nodejs-like module implementation
XXXX-XX-XX
, v0.4.2
2011-12-25
, v0.4.2
------------------
- merged PR #30 - Add request method and request data to the base64encode method (@jasonlfunk)
...
...
modules/utils.js
View file @
75a6f92
...
...
@@ -163,28 +163,6 @@ function mergeObjects(obj1, obj2) {
exports
.
mergeObjects
=
mergeObjects
;
/**
* Replaces a function string contents with placeholders provided by an
* Object.
*
* @param Function fn The function
* @param Object replacements Object containing placeholder replacements
* @return String A function string representation
*/
function
replaceFunctionPlaceholders
(
fn
,
replacements
)
{
if
(
replacements
&&
isType
(
replacements
,
"object"
))
{
fn
=
fn
.
toString
();
for
(
var
placeholder
in
replacements
)
{
var
match
=
'%'
+
placeholder
+
'%'
;
do
{
fn
=
fn
.
replace
(
match
,
replacements
[
placeholder
]);
}
while
(
fn
.
indexOf
(
match
)
!==
-
1
);
}
}
return
fn
;
}
exports
.
replaceFunctionPlaceholders
=
replaceFunctionPlaceholders
;
/**
* Serializes a value using JSON.
*
* @param Mixed value
...
...
Please
register
or
sign in
to post a comment