pulsar/spec/fixtures/sample-with-comments.js

32 lines
841 B
JavaScript
Raw Normal View History

2013-07-18 04:28:53 +04:00
var quicksort = function () {
/*
this is a multiline comment
it is, I promise
*/
var sort = function(items) { // comment at the end of a foldable line
2013-07-18 04:28:53 +04:00
// This is a collection of
// single line comments.
// Wowza
if (items.length <= 1) return items;
var pivot = items.shift(), current, left = [], right = [];
/*
This is a multiline comment block with
an empty line inside of it.
Awesome.
*/
2013-07-18 04:28:53 +04:00
while(items.length > 0) {
current = items.shift();
current < pivot ? left.push(current) : right.push(current);
}
// This is a collection of
// single line comments
// ...with an empty line
// among it, geez!
2013-07-18 04:28:53 +04:00
return sort(left).concat(pivot).concat(sort(right));
};
// this is a single-line comment
2013-07-18 04:28:53 +04:00
return sort(Array.apply(this, arguments));
};