Skip to content

Commit

Permalink
Catching carriage returns
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisAntaki committed Oct 22, 2014
1 parent 619cb2a commit 6d9fdff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bootstrap/create-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var createFunction = (function () {

// parse the function source into name, arguments, and body
// currently, names must by alphanumeric.
parsed = src.replace(/\n/g, newlineToken).
parsed = src.replace(/\r?\n/g, newlineToken).
match(/^function\s+([a-zA-Z_]\w*)?\s*\(([^)]*)\)\s*\{(.*)\}$/);
if (!parsed) {
throw 'Cannot parse function: ' +
Expand Down

0 comments on commit 6d9fdff

Please sign in to comment.