forked from jshint/jshint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit tests for function character locations
- Loading branch information
1 parent
1ac8c63
commit 4b16206
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// non-nested function with non-standard ending curly placement | ||
function a(x, y) { | ||
return x+y; | ||
} | ||
|
||
// regular nested function | ||
function b() { | ||
function c() { | ||
return 1+1; | ||
} | ||
return c(); | ||
} | ||
|
||
// anonymous nested function with params | ||
function d() { | ||
var e = function (x, y) { | ||
return x+y; | ||
}; | ||
return e; | ||
} | ||
|
||
// anonymous nested function in parens | ||
function f() { | ||
(function () { | ||
return 1+1; | ||
})(); | ||
} | ||
|
||
// all on one line with non-standard parenthesis placement | ||
function g() { return function h () { return 1+1; };} | ||
|
||
// function in object | ||
var i = { | ||
j : function () { return 1+1; } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters