summaryrefslogtreecommitdiff
path: root/docs/ast/source/priorityQueue.js.json
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ast/source/priorityQueue.js.json')
-rw-r--r--docs/ast/source/priorityQueue.js.json4554
1 files changed, 4554 insertions, 0 deletions
diff --git a/docs/ast/source/priorityQueue.js.json b/docs/ast/source/priorityQueue.js.json
new file mode 100644
index 0000000..1e943cc
--- /dev/null
+++ b/docs/ast/source/priorityQueue.js.json
@@ -0,0 +1,4554 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "local": {
+ "type": "Identifier",
+ "name": "arrayEach",
+ "range": [
+ 7,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "range": [
+ 7,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "value": "lodash/_arrayEach",
+ "raw": "'lodash/_arrayEach'",
+ "range": [
+ 22,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ }
+ },
+ "range": [
+ 0,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ }
+ },
+ {
+ "type": "ImportDeclaration",
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "local": {
+ "type": "Identifier",
+ "name": "isArray",
+ "range": [
+ 50,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 50,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "value": "lodash/isArray",
+ "raw": "'lodash/isArray'",
+ "range": [
+ 63,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ }
+ },
+ "range": [
+ 43,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ }
+ },
+ {
+ "type": "ImportDeclaration",
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "local": {
+ "type": "Identifier",
+ "name": "noop",
+ "range": [
+ 88,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 88,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "value": "lodash/noop",
+ "raw": "'lodash/noop'",
+ "range": [
+ 98,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ }
+ },
+ "range": [
+ 81,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ }
+ },
+ {
+ "type": "ImportDeclaration",
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "local": {
+ "type": "Identifier",
+ "name": "setImmediate",
+ "range": [
+ 121,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ }
+ },
+ "range": [
+ 121,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "value": "./setImmediate",
+ "raw": "'./setImmediate'",
+ "range": [
+ 139,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ }
+ },
+ "range": [
+ 114,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ }
+ },
+ {
+ "type": "ImportDeclaration",
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "local": {
+ "type": "Identifier",
+ "name": "queue",
+ "range": [
+ 165,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 165,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "value": "./queue",
+ "raw": "'./queue'",
+ "range": [
+ 176,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 158,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 28
+ }
+ },
+ "trailingComments": [
+ {
+ "type": "Block",
+ "value": "*\n * The same as {@link async.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf async\n * @see async.queue\n * @category Control Flow\n * @param {Function} worker - An asynchronous function for processing a queued\n * task, which must call its `callback(err)` argument when finished, with an\n * optional `error` as an argument. If you want to handle errors from an\n * individual task, pass a callback to `q.push()`. Invoked with\n * (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {queue} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n ",
+ "range": [
+ 188,
+ 1279
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 31,
+ "column": 3
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "ExportDefaultDeclaration",
+ "declaration": {
+ "type": "FunctionDeclaration",
+ "id": null,
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "worker",
+ "range": [
+ 1304,
+ 1310
+ ],
+ "loc": {
+ "start": {
+ "line": 32,
+ "column": 24
+ },
+ "end": {
+ "line": 32,
+ "column": 30
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "concurrency",
+ "range": [
+ 1312,
+ 1323
+ ],
+ "loc": {
+ "start": {
+ "line": 32,
+ "column": 32
+ },
+ "end": {
+ "line": 32,
+ "column": 43
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "_compareTasks",
+ "range": [
+ 1340,
+ 1353
+ ],
+ "loc": {
+ "start": {
+ "line": 33,
+ "column": 13
+ },
+ "end": {
+ "line": 33,
+ "column": 26
+ }
+ }
+ },
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 1354,
+ 1355
+ ],
+ "loc": {
+ "start": {
+ "line": 33,
+ "column": 27
+ },
+ "end": {
+ "line": 33,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "b",
+ "range": [
+ 1357,
+ 1358
+ ],
+ "loc": {
+ "start": {
+ "line": 33,
+ "column": 30
+ },
+ "end": {
+ "line": 33,
+ "column": 31
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "argument": {
+ "type": "BinaryExpression",
+ "operator": "-",
+ "left": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 1377,
+ 1378
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 15
+ },
+ "end": {
+ "line": 34,
+ "column": 16
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 1379,
+ 1387
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 17
+ },
+ "end": {
+ "line": 34,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 1377,
+ 1387
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 15
+ },
+ "end": {
+ "line": 34,
+ "column": 25
+ }
+ }
+ },
+ "right": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "b",
+ "range": [
+ 1390,
+ 1391
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 28
+ },
+ "end": {
+ "line": 34,
+ "column": 29
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 1392,
+ 1400
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 30
+ },
+ "end": {
+ "line": 34,
+ "column": 38
+ }
+ }
+ },
+ "range": [
+ 1390,
+ 1400
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 28
+ },
+ "end": {
+ "line": 34,
+ "column": 38
+ }
+ }
+ },
+ "range": [
+ 1377,
+ 1400
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 15
+ },
+ "end": {
+ "line": 34,
+ "column": 38
+ }
+ }
+ },
+ "range": [
+ 1370,
+ 1401
+ ],
+ "loc": {
+ "start": {
+ "line": 34,
+ "column": 8
+ },
+ "end": {
+ "line": 34,
+ "column": 39
+ }
+ }
+ }
+ ],
+ "range": [
+ 1360,
+ 1407
+ ],
+ "loc": {
+ "start": {
+ "line": 33,
+ "column": 33
+ },
+ "end": {
+ "line": 35,
+ "column": 5
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 1331,
+ 1407
+ ],
+ "loc": {
+ "start": {
+ "line": 33,
+ "column": 4
+ },
+ "end": {
+ "line": 35,
+ "column": 5
+ }
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "_binarySearch",
+ "range": [
+ 1422,
+ 1435
+ ],
+ "loc": {
+ "start": {
+ "line": 37,
+ "column": 13
+ },
+ "end": {
+ "line": 37,
+ "column": 26
+ }
+ }
+ },
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "sequence",
+ "range": [
+ 1436,
+ 1444
+ ],
+ "loc": {
+ "start": {
+ "line": 37,
+ "column": 27
+ },
+ "end": {
+ "line": 37,
+ "column": 35
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "item",
+ "range": [
+ 1446,
+ 1450
+ ],
+ "loc": {
+ "start": {
+ "line": 37,
+ "column": 37
+ },
+ "end": {
+ "line": 37,
+ "column": 41
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "compare",
+ "range": [
+ 1452,
+ 1459
+ ],
+ "loc": {
+ "start": {
+ "line": 37,
+ "column": 43
+ },
+ "end": {
+ "line": 37,
+ "column": 50
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "beg",
+ "range": [
+ 1475,
+ 1478
+ ],
+ "loc": {
+ "start": {
+ "line": 38,
+ "column": 12
+ },
+ "end": {
+ "line": 38,
+ "column": 15
+ }
+ }
+ },
+ "init": {
+ "type": "UnaryExpression",
+ "operator": "-",
+ "argument": {
+ "type": "Literal",
+ "value": 1,
+ "raw": "1",
+ "range": [
+ 1482,
+ 1483
+ ],
+ "loc": {
+ "start": {
+ "line": 38,
+ "column": 19
+ },
+ "end": {
+ "line": 38,
+ "column": 20
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 1481,
+ 1483
+ ],
+ "loc": {
+ "start": {
+ "line": 38,
+ "column": 18
+ },
+ "end": {
+ "line": 38,
+ "column": 20
+ }
+ }
+ },
+ "range": [
+ 1475,
+ 1483
+ ],
+ "loc": {
+ "start": {
+ "line": 38,
+ "column": 12
+ },
+ "end": {
+ "line": 38,
+ "column": 20
+ }
+ }
+ },
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "end",
+ "range": [
+ 1497,
+ 1500
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 12
+ },
+ "end": {
+ "line": 39,
+ "column": 15
+ }
+ }
+ },
+ "init": {
+ "type": "BinaryExpression",
+ "operator": "-",
+ "left": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "sequence",
+ "range": [
+ 1503,
+ 1511
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 18
+ },
+ "end": {
+ "line": 39,
+ "column": 26
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "length",
+ "range": [
+ 1512,
+ 1518
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 27
+ },
+ "end": {
+ "line": 39,
+ "column": 33
+ }
+ }
+ },
+ "range": [
+ 1503,
+ 1518
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 18
+ },
+ "end": {
+ "line": 39,
+ "column": 33
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 1,
+ "raw": "1",
+ "range": [
+ 1521,
+ 1522
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 36
+ },
+ "end": {
+ "line": 39,
+ "column": 37
+ }
+ }
+ },
+ "range": [
+ 1503,
+ 1522
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 18
+ },
+ "end": {
+ "line": 39,
+ "column": 37
+ }
+ }
+ },
+ "range": [
+ 1497,
+ 1522
+ ],
+ "loc": {
+ "start": {
+ "line": 39,
+ "column": 12
+ },
+ "end": {
+ "line": 39,
+ "column": 37
+ }
+ }
+ }
+ ],
+ "kind": "var",
+ "range": [
+ 1471,
+ 1523
+ ],
+ "loc": {
+ "start": {
+ "line": 38,
+ "column": 8
+ },
+ "end": {
+ "line": 39,
+ "column": 38
+ }
+ }
+ },
+ {
+ "type": "WhileStatement",
+ "test": {
+ "type": "BinaryExpression",
+ "operator": "<",
+ "left": {
+ "type": "Identifier",
+ "name": "beg",
+ "range": [
+ 1539,
+ 1542
+ ],
+ "loc": {
+ "start": {
+ "line": 40,
+ "column": 15
+ },
+ "end": {
+ "line": 40,
+ "column": 18
+ }
+ }
+ },
+ "right": {
+ "type": "Identifier",
+ "name": "end",
+ "range": [
+ 1545,
+ 1548
+ ],
+ "loc": {
+ "start": {
+ "line": 40,
+ "column": 21
+ },
+ "end": {
+ "line": 40,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 1539,
+ 1548
+ ],
+ "loc": {
+ "start": {
+ "line": 40,
+ "column": 15
+ },
+ "end": {
+ "line": 40,
+ "column": 24
+ }
+ }
+ },
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "mid",
+ "range": [
+ 1568,
+ 1571
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 16
+ },
+ "end": {
+ "line": 41,
+ "column": 19
+ }
+ }
+ },
+ "init": {
+ "type": "BinaryExpression",
+ "operator": "+",
+ "left": {
+ "type": "Identifier",
+ "name": "beg",
+ "range": [
+ 1574,
+ 1577
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 22
+ },
+ "end": {
+ "line": 41,
+ "column": 25
+ }
+ }
+ },
+ "right": {
+ "type": "BinaryExpression",
+ "operator": ">>>",
+ "left": {
+ "type": "BinaryExpression",
+ "operator": "+",
+ "left": {
+ "type": "BinaryExpression",
+ "operator": "-",
+ "left": {
+ "type": "Identifier",
+ "name": "end",
+ "range": [
+ 1582,
+ 1585
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 30
+ },
+ "end": {
+ "line": 41,
+ "column": 33
+ }
+ }
+ },
+ "right": {
+ "type": "Identifier",
+ "name": "beg",
+ "range": [
+ 1588,
+ 1591
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 36
+ },
+ "end": {
+ "line": 41,
+ "column": 39
+ }
+ }
+ },
+ "range": [
+ 1582,
+ 1591
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 30
+ },
+ "end": {
+ "line": 41,
+ "column": 39
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 1,
+ "raw": "1",
+ "range": [
+ 1594,
+ 1595
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 42
+ },
+ "end": {
+ "line": 41,
+ "column": 43
+ }
+ }
+ },
+ "range": [
+ 1582,
+ 1595
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 30
+ },
+ "end": {
+ "line": 41,
+ "column": 43
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 1,
+ "raw": "1",
+ "range": [
+ 1601,
+ 1602
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 49
+ },
+ "end": {
+ "line": 41,
+ "column": 50
+ }
+ }
+ },
+ "range": [
+ 1581,
+ 1602
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 29
+ },
+ "end": {
+ "line": 41,
+ "column": 50
+ }
+ }
+ },
+ "range": [
+ 1574,
+ 1603
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 22
+ },
+ "end": {
+ "line": 41,
+ "column": 51
+ }
+ }
+ },
+ "range": [
+ 1568,
+ 1603
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 16
+ },
+ "end": {
+ "line": 41,
+ "column": 51
+ }
+ }
+ }
+ ],
+ "kind": "var",
+ "range": [
+ 1564,
+ 1604
+ ],
+ "loc": {
+ "start": {
+ "line": 41,
+ "column": 12
+ },
+ "end": {
+ "line": 41,
+ "column": 52
+ }
+ }
+ },
+ {
+ "type": "IfStatement",
+ "test": {
+ "type": "BinaryExpression",
+ "operator": ">=",
+ "left": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "compare",
+ "range": [
+ 1621,
+ 1628
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 16
+ },
+ "end": {
+ "line": 42,
+ "column": 23
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "name": "item",
+ "range": [
+ 1629,
+ 1633
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 24
+ },
+ "end": {
+ "line": 42,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "MemberExpression",
+ "computed": true,
+ "object": {
+ "type": "Identifier",
+ "name": "sequence",
+ "range": [
+ 1635,
+ 1643
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 30
+ },
+ "end": {
+ "line": 42,
+ "column": 38
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "mid",
+ "range": [
+ 1644,
+ 1647
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 39
+ },
+ "end": {
+ "line": 42,
+ "column": 42
+ }
+ }
+ },
+ "range": [
+ 1635,
+ 1648
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 30
+ },
+ "end": {
+ "line": 42,
+ "column": 43
+ }
+ }
+ }
+ ],
+ "range": [
+ 1621,
+ 1649
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 16
+ },
+ "end": {
+ "line": 42,
+ "column": 44
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 0,
+ "raw": "0",
+ "range": [
+ 1653,
+ 1654
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 48
+ },
+ "end": {
+ "line": 42,
+ "column": 49
+ }
+ }
+ },
+ "range": [
+ 1621,
+ 1654
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 16
+ },
+ "end": {
+ "line": 42,
+ "column": 49
+ }
+ }
+ },
+ "consequent": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "AssignmentExpression",
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "name": "beg",
+ "range": [
+ 1674,
+ 1677
+ ],
+ "loc": {
+ "start": {
+ "line": 43,
+ "column": 16
+ },
+ "end": {
+ "line": 43,
+ "column": 19
+ }
+ }
+ },
+ "right": {
+ "type": "Identifier",
+ "name": "mid",
+ "range": [
+ 1680,
+ 1683
+ ],
+ "loc": {
+ "start": {
+ "line": 43,
+ "column": 22
+ },
+ "end": {
+ "line": 43,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 1674,
+ 1683
+ ],
+ "loc": {
+ "start": {
+ "line": 43,
+ "column": 16
+ },
+ "end": {
+ "line": 43,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 1674,
+ 1684
+ ],
+ "loc": {
+ "start": {
+ "line": 43,
+ "column": 16
+ },
+ "end": {
+ "line": 43,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 1656,
+ 1698
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 51
+ },
+ "end": {
+ "line": 44,
+ "column": 13
+ }
+ }
+ },
+ "alternate": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "AssignmentExpression",
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "name": "end",
+ "range": [
+ 1722,
+ 1725
+ ],
+ "loc": {
+ "start": {
+ "line": 45,
+ "column": 16
+ },
+ "end": {
+ "line": 45,
+ "column": 19
+ }
+ }
+ },
+ "right": {
+ "type": "BinaryExpression",
+ "operator": "-",
+ "left": {
+ "type": "Identifier",
+ "name": "mid",
+ "range": [
+ 1728,
+ 1731
+ ],
+ "loc": {
+ "start": {
+ "line": 45,
+ "column": 22
+ },
+ "end": {
+ "line": 45,
+ "column": 25
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 1,
+ "raw": "1",
+ "range": [
+ 1734,
+ 1735
+ ],
+ "loc": {
+ "start": {
+ "line": 45,
+ "column": 28
+ },
+ "end": {
+ "line": 45,
+ "column": 29
+ }
+ }
+ },
+ "range": [
+ 1728,
+ 1735
+ ],
+ "loc": {
+ "start": {
+ "line": 45,
+ "column": 22
+ },
+ "end": {
+ "line": 45,
+ "column": 29
+ }
+ }
+ },
+ "range": [
+ 1722,
+ 1735
+ ],
+ "loc": {
+ "start": {
+ "line": 45,
+ "column": 16
+ },
+ "end": {
+ "line": 45,
+ "column": 29
+ }
+ }
+ },
+ "range": [
+ 1722,
+ 1736
+ ],
+ "loc": {
+ "start": {
+ "line": 45,
+ "column": 16
+ },
+ "end": {
+ "line": 45,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "range": [
+ 1704,
+ 1750
+ ],
+ "loc": {
+ "start": {
+ "line": 44,
+ "column": 19
+ },
+ "end": {
+ "line": 46,
+ "column": 13
+ }
+ }
+ },
+ "range": [
+ 1617,
+ 1750
+ ],
+ "loc": {
+ "start": {
+ "line": 42,
+ "column": 12
+ },
+ "end": {
+ "line": 46,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "range": [
+ 1550,
+ 1760
+ ],
+ "loc": {
+ "start": {
+ "line": 40,
+ "column": 26
+ },
+ "end": {
+ "line": 47,
+ "column": 9
+ }
+ }
+ },
+ "range": [
+ 1532,
+ 1760
+ ],
+ "loc": {
+ "start": {
+ "line": 40,
+ "column": 8
+ },
+ "end": {
+ "line": 47,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "ReturnStatement",
+ "argument": {
+ "type": "Identifier",
+ "name": "beg",
+ "range": [
+ 1776,
+ 1779
+ ],
+ "loc": {
+ "start": {
+ "line": 48,
+ "column": 15
+ },
+ "end": {
+ "line": 48,
+ "column": 18
+ }
+ }
+ },
+ "range": [
+ 1769,
+ 1780
+ ],
+ "loc": {
+ "start": {
+ "line": 48,
+ "column": 8
+ },
+ "end": {
+ "line": 48,
+ "column": 19
+ }
+ }
+ }
+ ],
+ "range": [
+ 1461,
+ 1786
+ ],
+ "loc": {
+ "start": {
+ "line": 37,
+ "column": 52
+ },
+ "end": {
+ "line": 49,
+ "column": 5
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 1413,
+ 1786
+ ],
+ "loc": {
+ "start": {
+ "line": 37,
+ "column": 4
+ },
+ "end": {
+ "line": 49,
+ "column": 5
+ }
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "_insert",
+ "range": [
+ 1801,
+ 1808
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 13
+ },
+ "end": {
+ "line": 51,
+ "column": 20
+ }
+ }
+ },
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 1809,
+ 1810
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 21
+ },
+ "end": {
+ "line": 51,
+ "column": 22
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 1812,
+ 1816
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 24
+ },
+ "end": {
+ "line": 51,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 1818,
+ 1826
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 30
+ },
+ "end": {
+ "line": 51,
+ "column": 38
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 1828,
+ 1836
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 40
+ },
+ "end": {
+ "line": 51,
+ "column": 48
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "IfStatement",
+ "test": {
+ "type": "LogicalExpression",
+ "operator": "&&",
+ "left": {
+ "type": "BinaryExpression",
+ "operator": "!=",
+ "left": {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 1852,
+ 1860
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 12
+ },
+ "end": {
+ "line": 52,
+ "column": 20
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": null,
+ "raw": "null",
+ "range": [
+ 1864,
+ 1868
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 24
+ },
+ "end": {
+ "line": 52,
+ "column": 28
+ }
+ }
+ },
+ "range": [
+ 1852,
+ 1868
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 12
+ },
+ "end": {
+ "line": 52,
+ "column": 28
+ }
+ }
+ },
+ "right": {
+ "type": "BinaryExpression",
+ "operator": "!==",
+ "left": {
+ "type": "UnaryExpression",
+ "operator": "typeof",
+ "argument": {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 1879,
+ 1887
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 39
+ },
+ "end": {
+ "line": 52,
+ "column": 47
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 1872,
+ 1887
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 32
+ },
+ "end": {
+ "line": 52,
+ "column": 47
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": "function",
+ "raw": "'function'",
+ "range": [
+ 1892,
+ 1902
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 52
+ },
+ "end": {
+ "line": 52,
+ "column": 62
+ }
+ }
+ },
+ "range": [
+ 1872,
+ 1902
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 32
+ },
+ "end": {
+ "line": 52,
+ "column": 62
+ }
+ }
+ },
+ "range": [
+ 1852,
+ 1902
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 12
+ },
+ "end": {
+ "line": 52,
+ "column": 62
+ }
+ }
+ },
+ "consequent": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ThrowStatement",
+ "argument": {
+ "type": "NewExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "Error",
+ "range": [
+ 1928,
+ 1933
+ ],
+ "loc": {
+ "start": {
+ "line": 53,
+ "column": 22
+ },
+ "end": {
+ "line": 53,
+ "column": 27
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Literal",
+ "value": "task callback must be a function",
+ "raw": "'task callback must be a function'",
+ "range": [
+ 1934,
+ 1968
+ ],
+ "loc": {
+ "start": {
+ "line": 53,
+ "column": 28
+ },
+ "end": {
+ "line": 53,
+ "column": 62
+ }
+ }
+ }
+ ],
+ "range": [
+ 1924,
+ 1969
+ ],
+ "loc": {
+ "start": {
+ "line": 53,
+ "column": 18
+ },
+ "end": {
+ "line": 53,
+ "column": 63
+ }
+ }
+ },
+ "range": [
+ 1918,
+ 1970
+ ],
+ "loc": {
+ "start": {
+ "line": 53,
+ "column": 12
+ },
+ "end": {
+ "line": 53,
+ "column": 64
+ }
+ }
+ }
+ ],
+ "range": [
+ 1904,
+ 1980
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 64
+ },
+ "end": {
+ "line": 54,
+ "column": 9
+ }
+ }
+ },
+ "alternate": null,
+ "range": [
+ 1848,
+ 1980
+ ],
+ "loc": {
+ "start": {
+ "line": 52,
+ "column": 8
+ },
+ "end": {
+ "line": 54,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "AssignmentExpression",
+ "operator": "=",
+ "left": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 1989,
+ 1990
+ ],
+ "loc": {
+ "start": {
+ "line": 55,
+ "column": 8
+ },
+ "end": {
+ "line": 55,
+ "column": 9
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "started",
+ "range": [
+ 1991,
+ 1998
+ ],
+ "loc": {
+ "start": {
+ "line": 55,
+ "column": 10
+ },
+ "end": {
+ "line": 55,
+ "column": 17
+ }
+ }
+ },
+ "range": [
+ 1989,
+ 1998
+ ],
+ "loc": {
+ "start": {
+ "line": 55,
+ "column": 8
+ },
+ "end": {
+ "line": 55,
+ "column": 17
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": true,
+ "raw": "true",
+ "range": [
+ 2001,
+ 2005
+ ],
+ "loc": {
+ "start": {
+ "line": 55,
+ "column": 20
+ },
+ "end": {
+ "line": 55,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 1989,
+ 2005
+ ],
+ "loc": {
+ "start": {
+ "line": 55,
+ "column": 8
+ },
+ "end": {
+ "line": 55,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 1989,
+ 2006
+ ],
+ "loc": {
+ "start": {
+ "line": 55,
+ "column": 8
+ },
+ "end": {
+ "line": 55,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "IfStatement",
+ "test": {
+ "type": "UnaryExpression",
+ "operator": "!",
+ "argument": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "isArray",
+ "range": [
+ 2020,
+ 2027
+ ],
+ "loc": {
+ "start": {
+ "line": 56,
+ "column": 13
+ },
+ "end": {
+ "line": 56,
+ "column": 20
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2028,
+ 2032
+ ],
+ "loc": {
+ "start": {
+ "line": 56,
+ "column": 21
+ },
+ "end": {
+ "line": 56,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "range": [
+ 2020,
+ 2033
+ ],
+ "loc": {
+ "start": {
+ "line": 56,
+ "column": 13
+ },
+ "end": {
+ "line": 56,
+ "column": 26
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 2019,
+ 2033
+ ],
+ "loc": {
+ "start": {
+ "line": 56,
+ "column": 12
+ },
+ "end": {
+ "line": 56,
+ "column": 26
+ }
+ }
+ },
+ "consequent": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "AssignmentExpression",
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2049,
+ 2053
+ ],
+ "loc": {
+ "start": {
+ "line": 57,
+ "column": 12
+ },
+ "end": {
+ "line": 57,
+ "column": 16
+ }
+ }
+ },
+ "right": {
+ "type": "ArrayExpression",
+ "elements": [
+ {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2057,
+ 2061
+ ],
+ "loc": {
+ "start": {
+ "line": 57,
+ "column": 20
+ },
+ "end": {
+ "line": 57,
+ "column": 24
+ }
+ }
+ }
+ ],
+ "range": [
+ 2056,
+ 2062
+ ],
+ "loc": {
+ "start": {
+ "line": 57,
+ "column": 19
+ },
+ "end": {
+ "line": 57,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 2049,
+ 2062
+ ],
+ "loc": {
+ "start": {
+ "line": 57,
+ "column": 12
+ },
+ "end": {
+ "line": 57,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 2049,
+ 2063
+ ],
+ "loc": {
+ "start": {
+ "line": 57,
+ "column": 12
+ },
+ "end": {
+ "line": 57,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 2035,
+ 2073
+ ],
+ "loc": {
+ "start": {
+ "line": 56,
+ "column": 28
+ },
+ "end": {
+ "line": 58,
+ "column": 9
+ }
+ }
+ },
+ "alternate": null,
+ "range": [
+ 2015,
+ 2073
+ ],
+ "loc": {
+ "start": {
+ "line": 56,
+ "column": 8
+ },
+ "end": {
+ "line": 58,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "IfStatement",
+ "test": {
+ "type": "BinaryExpression",
+ "operator": "===",
+ "left": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2086,
+ 2090
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 12
+ },
+ "end": {
+ "line": 59,
+ "column": 16
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "length",
+ "range": [
+ 2091,
+ 2097
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 17
+ },
+ "end": {
+ "line": 59,
+ "column": 23
+ }
+ }
+ },
+ "range": [
+ 2086,
+ 2097
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 12
+ },
+ "end": {
+ "line": 59,
+ "column": 23
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 0,
+ "raw": "0",
+ "range": [
+ 2102,
+ 2103
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 28
+ },
+ "end": {
+ "line": 59,
+ "column": 29
+ }
+ }
+ },
+ "range": [
+ 2086,
+ 2103
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 12
+ },
+ "end": {
+ "line": 59,
+ "column": 29
+ }
+ }
+ },
+ "consequent": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "argument": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "setImmediate",
+ "range": [
+ 2186,
+ 2198
+ ],
+ "loc": {
+ "start": {
+ "line": 61,
+ "column": 19
+ },
+ "end": {
+ "line": 61,
+ "column": 31
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "FunctionExpression",
+ "id": null,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2228,
+ 2229
+ ],
+ "loc": {
+ "start": {
+ "line": 62,
+ "column": 16
+ },
+ "end": {
+ "line": 62,
+ "column": 17
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "drain",
+ "range": [
+ 2230,
+ 2235
+ ],
+ "loc": {
+ "start": {
+ "line": 62,
+ "column": 18
+ },
+ "end": {
+ "line": 62,
+ "column": 23
+ }
+ }
+ },
+ "range": [
+ 2228,
+ 2235
+ ],
+ "loc": {
+ "start": {
+ "line": 62,
+ "column": 16
+ },
+ "end": {
+ "line": 62,
+ "column": 23
+ }
+ }
+ },
+ "arguments": [],
+ "range": [
+ 2228,
+ 2237
+ ],
+ "loc": {
+ "start": {
+ "line": 62,
+ "column": 16
+ },
+ "end": {
+ "line": 62,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 2228,
+ 2238
+ ],
+ "loc": {
+ "start": {
+ "line": 62,
+ "column": 16
+ },
+ "end": {
+ "line": 62,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 2210,
+ 2252
+ ],
+ "loc": {
+ "start": {
+ "line": 61,
+ "column": 43
+ },
+ "end": {
+ "line": 63,
+ "column": 13
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 2199,
+ 2252
+ ],
+ "loc": {
+ "start": {
+ "line": 61,
+ "column": 32
+ },
+ "end": {
+ "line": 63,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "range": [
+ 2186,
+ 2253
+ ],
+ "loc": {
+ "start": {
+ "line": 61,
+ "column": 19
+ },
+ "end": {
+ "line": 63,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 2179,
+ 2254
+ ],
+ "loc": {
+ "start": {
+ "line": 61,
+ "column": 12
+ },
+ "end": {
+ "line": 63,
+ "column": 15
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "Line",
+ "value": " call drain immediately if there are no tasks",
+ "range": [
+ 2119,
+ 2166
+ ],
+ "loc": {
+ "start": {
+ "line": 60,
+ "column": 12
+ },
+ "end": {
+ "line": 60,
+ "column": 59
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "range": [
+ 2105,
+ 2264
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 31
+ },
+ "end": {
+ "line": 64,
+ "column": 9
+ }
+ }
+ },
+ "alternate": null,
+ "range": [
+ 2082,
+ 2264
+ ],
+ "loc": {
+ "start": {
+ "line": 59,
+ "column": 8
+ },
+ "end": {
+ "line": 64,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "arrayEach",
+ "range": [
+ 2273,
+ 2282
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 8
+ },
+ "end": {
+ "line": 65,
+ "column": 17
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2283,
+ 2287
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 18
+ },
+ "end": {
+ "line": 65,
+ "column": 22
+ }
+ }
+ },
+ {
+ "type": "FunctionExpression",
+ "id": null,
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "task",
+ "range": [
+ 2298,
+ 2302
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 33
+ },
+ "end": {
+ "line": 65,
+ "column": 37
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "item",
+ "range": [
+ 2322,
+ 2326
+ ],
+ "loc": {
+ "start": {
+ "line": 66,
+ "column": 16
+ },
+ "end": {
+ "line": 66,
+ "column": 20
+ }
+ }
+ },
+ "init": {
+ "type": "ObjectExpression",
+ "properties": [
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2347,
+ 2351
+ ],
+ "loc": {
+ "start": {
+ "line": 67,
+ "column": 16
+ },
+ "end": {
+ "line": 67,
+ "column": 20
+ }
+ }
+ },
+ "value": {
+ "type": "Identifier",
+ "name": "task",
+ "range": [
+ 2353,
+ 2357
+ ],
+ "loc": {
+ "start": {
+ "line": 67,
+ "column": 22
+ },
+ "end": {
+ "line": 67,
+ "column": 26
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "range": [
+ 2347,
+ 2357
+ ],
+ "loc": {
+ "start": {
+ "line": 67,
+ "column": 16
+ },
+ "end": {
+ "line": 67,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 2375,
+ 2383
+ ],
+ "loc": {
+ "start": {
+ "line": 68,
+ "column": 16
+ },
+ "end": {
+ "line": 68,
+ "column": 24
+ }
+ }
+ },
+ "value": {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 2385,
+ 2393
+ ],
+ "loc": {
+ "start": {
+ "line": 68,
+ "column": 26
+ },
+ "end": {
+ "line": 68,
+ "column": 34
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "range": [
+ 2375,
+ 2393
+ ],
+ "loc": {
+ "start": {
+ "line": 68,
+ "column": 16
+ },
+ "end": {
+ "line": 68,
+ "column": 34
+ }
+ }
+ },
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 2411,
+ 2419
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 16
+ },
+ "end": {
+ "line": 69,
+ "column": 24
+ }
+ }
+ },
+ "value": {
+ "type": "ConditionalExpression",
+ "test": {
+ "type": "BinaryExpression",
+ "operator": "===",
+ "left": {
+ "type": "UnaryExpression",
+ "operator": "typeof",
+ "argument": {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 2428,
+ 2436
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 33
+ },
+ "end": {
+ "line": 69,
+ "column": 41
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 2421,
+ 2436
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 26
+ },
+ "end": {
+ "line": 69,
+ "column": 41
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": "function",
+ "raw": "'function'",
+ "range": [
+ 2441,
+ 2451
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 46
+ },
+ "end": {
+ "line": 69,
+ "column": 56
+ }
+ }
+ },
+ "range": [
+ 2421,
+ 2451
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 26
+ },
+ "end": {
+ "line": 69,
+ "column": 56
+ }
+ }
+ },
+ "consequent": {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 2454,
+ 2462
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 59
+ },
+ "end": {
+ "line": 69,
+ "column": 67
+ }
+ }
+ },
+ "alternate": {
+ "type": "Identifier",
+ "name": "noop",
+ "range": [
+ 2465,
+ 2469
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 70
+ },
+ "end": {
+ "line": 69,
+ "column": 74
+ }
+ }
+ },
+ "range": [
+ 2421,
+ 2469
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 26
+ },
+ "end": {
+ "line": 69,
+ "column": 74
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "range": [
+ 2411,
+ 2469
+ ],
+ "loc": {
+ "start": {
+ "line": 69,
+ "column": 16
+ },
+ "end": {
+ "line": 69,
+ "column": 74
+ }
+ }
+ }
+ ],
+ "range": [
+ 2329,
+ 2483
+ ],
+ "loc": {
+ "start": {
+ "line": 66,
+ "column": 23
+ },
+ "end": {
+ "line": 70,
+ "column": 13
+ }
+ }
+ },
+ "range": [
+ 2322,
+ 2483
+ ],
+ "loc": {
+ "start": {
+ "line": 66,
+ "column": 16
+ },
+ "end": {
+ "line": 70,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "kind": "var",
+ "range": [
+ 2318,
+ 2484
+ ],
+ "loc": {
+ "start": {
+ "line": 66,
+ "column": 12
+ },
+ "end": {
+ "line": 70,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2498,
+ 2499
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 12
+ },
+ "end": {
+ "line": 72,
+ "column": 13
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "tasks",
+ "range": [
+ 2500,
+ 2505
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 14
+ },
+ "end": {
+ "line": 72,
+ "column": 19
+ }
+ }
+ },
+ "range": [
+ 2498,
+ 2505
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 12
+ },
+ "end": {
+ "line": 72,
+ "column": 19
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "splice",
+ "range": [
+ 2506,
+ 2512
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 20
+ },
+ "end": {
+ "line": 72,
+ "column": 26
+ }
+ }
+ },
+ "range": [
+ 2498,
+ 2512
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 12
+ },
+ "end": {
+ "line": 72,
+ "column": 26
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "BinaryExpression",
+ "operator": "+",
+ "left": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "_binarySearch",
+ "range": [
+ 2513,
+ 2526
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 27
+ },
+ "end": {
+ "line": 72,
+ "column": 40
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2527,
+ 2528
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 41
+ },
+ "end": {
+ "line": 72,
+ "column": 42
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "tasks",
+ "range": [
+ 2529,
+ 2534
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 43
+ },
+ "end": {
+ "line": 72,
+ "column": 48
+ }
+ }
+ },
+ "range": [
+ 2527,
+ 2534
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 41
+ },
+ "end": {
+ "line": 72,
+ "column": 48
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "item",
+ "range": [
+ 2536,
+ 2540
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 50
+ },
+ "end": {
+ "line": 72,
+ "column": 54
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "_compareTasks",
+ "range": [
+ 2542,
+ 2555
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 56
+ },
+ "end": {
+ "line": 72,
+ "column": 69
+ }
+ }
+ }
+ ],
+ "range": [
+ 2513,
+ 2556
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 27
+ },
+ "end": {
+ "line": 72,
+ "column": 70
+ }
+ }
+ },
+ "right": {
+ "type": "Literal",
+ "value": 1,
+ "raw": "1",
+ "range": [
+ 2559,
+ 2560
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 73
+ },
+ "end": {
+ "line": 72,
+ "column": 74
+ }
+ }
+ },
+ "range": [
+ 2513,
+ 2560
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 27
+ },
+ "end": {
+ "line": 72,
+ "column": 74
+ }
+ }
+ },
+ {
+ "type": "Literal",
+ "value": 0,
+ "raw": "0",
+ "range": [
+ 2562,
+ 2563
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 76
+ },
+ "end": {
+ "line": 72,
+ "column": 77
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "item",
+ "range": [
+ 2565,
+ 2569
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 79
+ },
+ "end": {
+ "line": 72,
+ "column": 83
+ }
+ }
+ }
+ ],
+ "range": [
+ 2498,
+ 2570
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 12
+ },
+ "end": {
+ "line": 72,
+ "column": 84
+ }
+ }
+ },
+ "range": [
+ 2498,
+ 2571
+ ],
+ "loc": {
+ "start": {
+ "line": 72,
+ "column": 12
+ },
+ "end": {
+ "line": 72,
+ "column": 85
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "setImmediate",
+ "range": [
+ 2585,
+ 2597
+ ],
+ "loc": {
+ "start": {
+ "line": 74,
+ "column": 12
+ },
+ "end": {
+ "line": 74,
+ "column": 24
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2598,
+ 2599
+ ],
+ "loc": {
+ "start": {
+ "line": 74,
+ "column": 25
+ },
+ "end": {
+ "line": 74,
+ "column": 26
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "process",
+ "range": [
+ 2600,
+ 2607
+ ],
+ "loc": {
+ "start": {
+ "line": 74,
+ "column": 27
+ },
+ "end": {
+ "line": 74,
+ "column": 34
+ }
+ }
+ },
+ "range": [
+ 2598,
+ 2607
+ ],
+ "loc": {
+ "start": {
+ "line": 74,
+ "column": 25
+ },
+ "end": {
+ "line": 74,
+ "column": 34
+ }
+ }
+ }
+ ],
+ "range": [
+ 2585,
+ 2608
+ ],
+ "loc": {
+ "start": {
+ "line": 74,
+ "column": 12
+ },
+ "end": {
+ "line": 74,
+ "column": 35
+ }
+ }
+ },
+ "range": [
+ 2585,
+ 2609
+ ],
+ "loc": {
+ "start": {
+ "line": 74,
+ "column": 12
+ },
+ "end": {
+ "line": 74,
+ "column": 36
+ }
+ }
+ }
+ ],
+ "range": [
+ 2304,
+ 2619
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 39
+ },
+ "end": {
+ "line": 75,
+ "column": 9
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 2289,
+ 2619
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 24
+ },
+ "end": {
+ "line": 75,
+ "column": 9
+ }
+ }
+ }
+ ],
+ "range": [
+ 2273,
+ 2620
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 8
+ },
+ "end": {
+ "line": 75,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 2273,
+ 2621
+ ],
+ "loc": {
+ "start": {
+ "line": 65,
+ "column": 8
+ },
+ "end": {
+ "line": 75,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "range": [
+ 1838,
+ 2627
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 50
+ },
+ "end": {
+ "line": 76,
+ "column": 5
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 1792,
+ 2627
+ ],
+ "loc": {
+ "start": {
+ "line": 51,
+ "column": 4
+ },
+ "end": {
+ "line": 76,
+ "column": 5
+ }
+ },
+ "trailingComments": [
+ {
+ "type": "Line",
+ "value": " Start with a normal queue",
+ "range": [
+ 2633,
+ 2661
+ ],
+ "loc": {
+ "start": {
+ "line": 78,
+ "column": 4
+ },
+ "end": {
+ "line": 78,
+ "column": 32
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2670,
+ 2671
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 8
+ },
+ "end": {
+ "line": 79,
+ "column": 9
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "queue",
+ "range": [
+ 2674,
+ 2679
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 12
+ },
+ "end": {
+ "line": 79,
+ "column": 17
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "name": "worker",
+ "range": [
+ 2680,
+ 2686
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 18
+ },
+ "end": {
+ "line": 79,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "concurrency",
+ "range": [
+ 2688,
+ 2699
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 26
+ },
+ "end": {
+ "line": 79,
+ "column": 37
+ }
+ }
+ }
+ ],
+ "range": [
+ 2674,
+ 2700
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 12
+ },
+ "end": {
+ "line": 79,
+ "column": 38
+ }
+ }
+ },
+ "range": [
+ 2670,
+ 2700
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 8
+ },
+ "end": {
+ "line": 79,
+ "column": 38
+ }
+ }
+ }
+ ],
+ "kind": "var",
+ "range": [
+ 2666,
+ 2701
+ ],
+ "loc": {
+ "start": {
+ "line": 79,
+ "column": 4
+ },
+ "end": {
+ "line": 79,
+ "column": 39
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "Line",
+ "value": " Start with a normal queue",
+ "range": [
+ 2633,
+ 2661
+ ],
+ "loc": {
+ "start": {
+ "line": 78,
+ "column": 4
+ },
+ "end": {
+ "line": 78,
+ "column": 32
+ }
+ }
+ }
+ ],
+ "trailingComments": [
+ {
+ "type": "Line",
+ "value": " Override push to accept second parameter representing priority",
+ "range": [
+ 2707,
+ 2772
+ ],
+ "loc": {
+ "start": {
+ "line": 81,
+ "column": 4
+ },
+ "end": {
+ "line": 81,
+ "column": 69
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "AssignmentExpression",
+ "operator": "=",
+ "left": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2777,
+ 2778
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 4
+ },
+ "end": {
+ "line": 82,
+ "column": 5
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "push",
+ "range": [
+ 2779,
+ 2783
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 6
+ },
+ "end": {
+ "line": 82,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 2777,
+ 2783
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 4
+ },
+ "end": {
+ "line": 82,
+ "column": 10
+ }
+ }
+ },
+ "right": {
+ "type": "FunctionExpression",
+ "id": null,
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2795,
+ 2799
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 22
+ },
+ "end": {
+ "line": 82,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 2801,
+ 2809
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 28
+ },
+ "end": {
+ "line": 82,
+ "column": 36
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 2811,
+ 2819
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 38
+ },
+ "end": {
+ "line": 82,
+ "column": 46
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "_insert",
+ "range": [
+ 2831,
+ 2838
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 8
+ },
+ "end": {
+ "line": 83,
+ "column": 15
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2839,
+ 2840
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 16
+ },
+ "end": {
+ "line": 83,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "data",
+ "range": [
+ 2842,
+ 2846
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 19
+ },
+ "end": {
+ "line": 83,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "priority",
+ "range": [
+ 2848,
+ 2856
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 25
+ },
+ "end": {
+ "line": 83,
+ "column": 33
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "callback",
+ "range": [
+ 2858,
+ 2866
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 35
+ },
+ "end": {
+ "line": 83,
+ "column": 43
+ }
+ }
+ }
+ ],
+ "range": [
+ 2831,
+ 2867
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 8
+ },
+ "end": {
+ "line": 83,
+ "column": 44
+ }
+ }
+ },
+ "range": [
+ 2831,
+ 2868
+ ],
+ "loc": {
+ "start": {
+ "line": 83,
+ "column": 8
+ },
+ "end": {
+ "line": 83,
+ "column": 45
+ }
+ }
+ }
+ ],
+ "range": [
+ 2821,
+ 2874
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 48
+ },
+ "end": {
+ "line": 84,
+ "column": 5
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 2786,
+ 2874
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 13
+ },
+ "end": {
+ "line": 84,
+ "column": 5
+ }
+ }
+ },
+ "range": [
+ 2777,
+ 2874
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 4
+ },
+ "end": {
+ "line": 84,
+ "column": 5
+ }
+ }
+ },
+ "range": [
+ 2777,
+ 2875
+ ],
+ "loc": {
+ "start": {
+ "line": 82,
+ "column": 4
+ },
+ "end": {
+ "line": 84,
+ "column": 6
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "Line",
+ "value": " Override push to accept second parameter representing priority",
+ "range": [
+ 2707,
+ 2772
+ ],
+ "loc": {
+ "start": {
+ "line": 81,
+ "column": 4
+ },
+ "end": {
+ "line": 81,
+ "column": 69
+ }
+ }
+ }
+ ],
+ "trailingComments": [
+ {
+ "type": "Line",
+ "value": " Remove unshift function",
+ "range": [
+ 2881,
+ 2907
+ ],
+ "loc": {
+ "start": {
+ "line": 86,
+ "column": 4
+ },
+ "end": {
+ "line": 86,
+ "column": 30
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "UnaryExpression",
+ "operator": "delete",
+ "argument": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2919,
+ 2920
+ ],
+ "loc": {
+ "start": {
+ "line": 87,
+ "column": 11
+ },
+ "end": {
+ "line": 87,
+ "column": 12
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "unshift",
+ "range": [
+ 2921,
+ 2928
+ ],
+ "loc": {
+ "start": {
+ "line": 87,
+ "column": 13
+ },
+ "end": {
+ "line": 87,
+ "column": 20
+ }
+ }
+ },
+ "range": [
+ 2919,
+ 2928
+ ],
+ "loc": {
+ "start": {
+ "line": 87,
+ "column": 11
+ },
+ "end": {
+ "line": 87,
+ "column": 20
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 2912,
+ 2928
+ ],
+ "loc": {
+ "start": {
+ "line": 87,
+ "column": 4
+ },
+ "end": {
+ "line": 87,
+ "column": 20
+ }
+ }
+ },
+ "range": [
+ 2912,
+ 2929
+ ],
+ "loc": {
+ "start": {
+ "line": 87,
+ "column": 4
+ },
+ "end": {
+ "line": 87,
+ "column": 21
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "Line",
+ "value": " Remove unshift function",
+ "range": [
+ 2881,
+ 2907
+ ],
+ "loc": {
+ "start": {
+ "line": 86,
+ "column": 4
+ },
+ "end": {
+ "line": 86,
+ "column": 30
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "ReturnStatement",
+ "argument": {
+ "type": "Identifier",
+ "name": "q",
+ "range": [
+ 2942,
+ 2943
+ ],
+ "loc": {
+ "start": {
+ "line": 89,
+ "column": 11
+ },
+ "end": {
+ "line": 89,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 2935,
+ 2944
+ ],
+ "loc": {
+ "start": {
+ "line": 89,
+ "column": 4
+ },
+ "end": {
+ "line": 89,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "range": [
+ 1325,
+ 2946
+ ],
+ "loc": {
+ "start": {
+ "line": 32,
+ "column": 45
+ },
+ "end": {
+ "line": 90,
+ "column": 1
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 1295,
+ 2946
+ ],
+ "loc": {
+ "start": {
+ "line": 32,
+ "column": 15
+ },
+ "end": {
+ "line": 90,
+ "column": 1
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "Block",
+ "value": "*\n * The same as {@link async.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf async\n * @see async.queue\n * @category Control Flow\n * @param {Function} worker - An asynchronous function for processing a queued\n * task, which must call its `callback(err)` argument when finished, with an\n * optional `error` as an argument. If you want to handle errors from an\n * individual task, pass a callback to `q.push()`. Invoked with\n * (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {queue} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n ",
+ "range": [
+ 188,
+ 1279
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 31,
+ "column": 3
+ }
+ }
+ }
+ ],
+ "trailingComments": []
+ },
+ "range": [
+ 1280,
+ 2946
+ ],
+ "loc": {
+ "start": {
+ "line": 32,
+ "column": 0
+ },
+ "end": {
+ "line": 90,
+ "column": 1
+ }
+ },
+ "leadingComments": [
+ {
+ "type": "Block",
+ "value": "*\n * The same as {@link async.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf async\n * @see async.queue\n * @category Control Flow\n * @param {Function} worker - An asynchronous function for processing a queued\n * task, which must call its `callback(err)` argument when finished, with an\n * optional `error` as an argument. If you want to handle errors from an\n * individual task, pass a callback to `q.push()`. Invoked with\n * (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {queue} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n ",
+ "range": [
+ 188,
+ 1279
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 31,
+ "column": 3
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "sourceType": "module",
+ "range": [
+ 0,
+ 2946
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 90,
+ "column": 1
+ }
+ },
+ "comments": [
+ {
+ "type": "Block",
+ "value": "*\n * The same as {@link async.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf async\n * @see async.queue\n * @category Control Flow\n * @param {Function} worker - An asynchronous function for processing a queued\n * task, which must call its `callback(err)` argument when finished, with an\n * optional `error` as an argument. If you want to handle errors from an\n * individual task, pass a callback to `q.push()`. Invoked with\n * (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {queue} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n ",
+ "range": [
+ 188,
+ 1279
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 31,
+ "column": 3
+ }
+ }
+ },
+ {
+ "type": "Line",
+ "value": " call drain immediately if there are no tasks",
+ "range": [
+ 2119,
+ 2166
+ ],
+ "loc": {
+ "start": {
+ "line": 60,
+ "column": 12
+ },
+ "end": {
+ "line": 60,
+ "column": 59
+ }
+ }
+ },
+ {
+ "type": "Line",
+ "value": " Start with a normal queue",
+ "range": [
+ 2633,
+ 2661
+ ],
+ "loc": {
+ "start": {
+ "line": 78,
+ "column": 4
+ },
+ "end": {
+ "line": 78,
+ "column": 32
+ }
+ }
+ },
+ {
+ "type": "Line",
+ "value": " Override push to accept second parameter representing priority",
+ "range": [
+ 2707,
+ 2772
+ ],
+ "loc": {
+ "start": {
+ "line": 81,
+ "column": 4
+ },
+ "end": {
+ "line": 81,
+ "column": 69
+ }
+ }
+ },
+ {
+ "type": "Line",
+ "value": " Remove unshift function",
+ "range": [
+ 2881,
+ 2907
+ ],
+ "loc": {
+ "start": {
+ "line": 86,
+ "column": 4
+ },
+ "end": {
+ "line": 86,
+ "column": 30
+ }
+ }
+ }
+ ]
+} \ No newline at end of file