Skip to content

Commit d2c9d51

Browse files
committed
Update built files
1 parent de8d4c4 commit d2c9d51

File tree

3 files changed

+109
-80
lines changed

3 files changed

+109
-80
lines changed

dist/async.js

+31-3
Original file line numberDiff line numberDiff line change
@@ -1197,10 +1197,36 @@
11971197
var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;
11981198
var FN_ARG_SPLIT = /,/;
11991199
var FN_ARG = /(=.+)?(\s*)$/;
1200-
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
1200+
1201+
function stripComments(string) {
1202+
let stripped = '';
1203+
let index = 0;
1204+
let endBlockComment = string.indexOf('*/');
1205+
while (index < string.length) {
1206+
if (string[index] === '/' && string[index+1] === '/') {
1207+
// inline comment
1208+
let endIndex = string.indexOf('\n', index);
1209+
index = (endIndex === -1) ? string.length : endIndex;
1210+
} else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) {
1211+
// block comment
1212+
let endIndex = string.indexOf('*/', index);
1213+
if (endIndex !== -1) {
1214+
index = endIndex + 2;
1215+
endBlockComment = string.indexOf('*/', index);
1216+
} else {
1217+
stripped += string[index];
1218+
index++;
1219+
}
1220+
} else {
1221+
stripped += string[index];
1222+
index++;
1223+
}
1224+
}
1225+
return stripped;
1226+
}
12011227

12021228
function parseParams(func) {
1203-
const src = func.toString().replace(STRIP_COMMENTS, '');
1229+
const src = stripComments(func.toString());
12041230
let match = src.match(FN_ARGS);
12051231
if (!match) {
12061232
match = src.match(ARROW_FN_ARGS);
@@ -1957,7 +1983,7 @@
19571983
* app.get('/cats', function(request, response) {
19581984
* var User = request.models.User;
19591985
* async.seq(
1960-
* _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
1986+
* User.get.bind(User), // 'User.get' has signature (id, callback(err, data))
19611987
* function(user, fn) {
19621988
* user.getCats(fn); // 'getCats' has signature (callback(err, data))
19631989
* }
@@ -3591,6 +3617,8 @@
35913617
return memoized;
35923618
}
35933619

3620+
/* istanbul ignore file */
3621+
35943622
/**
35953623
* Calls `callback` on a later loop around the event loop. In Node.js this just
35963624
* calls `process.nextTick`. In the browser it will use `setImmediate` if

0 commit comments

Comments
 (0)