mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
add a new sample with some comments
This commit is contained in:
parent
4187615fa7
commit
519c514092
20
spec/fixtures/sample-with-comments.js
vendored
Normal file
20
spec/fixtures/sample-with-comments.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
var quicksort = function () {
|
||||
/*
|
||||
this is a multiline comment
|
||||
it is, I promise
|
||||
*/
|
||||
var sort = function(items) {
|
||||
// This is a collection of
|
||||
// single line comments.
|
||||
// Wowza
|
||||
if (items.length <= 1) return items;
|
||||
var pivot = items.shift(), current, left = [], right = [];
|
||||
while(items.length > 0) {
|
||||
current = items.shift();
|
||||
current < pivot ? left.push(current) : right.push(current);
|
||||
}
|
||||
return sort(left).concat(pivot).concat(sort(right));
|
||||
};
|
||||
|
||||
return sort(Array.apply(this, arguments));
|
||||
};
|
Loading…
Reference in New Issue
Block a user