/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
spec/fixtures/sample-with-comments.js
31 строка
841 B
Antonio Scandurra
Fix folding for lines that contain a comment
17 авг 2017, 15:28
17 авг 2017, 15:28
c99ac52
Код
Авторство
О чём код?
var quicksort = function () { /* this is a multiline comment it is, I promise */ var sort = function(items) { // comment at the end of a foldable line // 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. */ 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! return sort(left).concat(pivot).concat(sort(right)); }; // this is a single-line comment return sort(Array.apply(this, arguments)); };