Merge pull request #11001 from Snuffleupagus/Parser-shift-rm-isCmd

Inline the `isCmd` check in the `Parser.shift` method
This commit is contained in:
Tim van der Meij 2019-07-22 22:32:53 +02:00 committed by GitHub
commit 1f287ec486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class Parser {
}
shift() {
if (isCmd(this.buf2, 'ID')) {
if ((this.buf2 instanceof Cmd) && this.buf2.cmd === 'ID') {
this.buf1 = this.buf2;
this.buf2 = null;
} else {

View File

@ -1331,7 +1331,7 @@ describe('api', function() {
let [statEntry] = stats.times;
expect(statEntry.name).toEqual('Page Request');
expect(statEntry.end - statEntry.start).toBeGreaterThan(0);
expect(statEntry.end - statEntry.start).toBeGreaterThanOrEqual(0);
loadingTask.destroy().then(done);
}, done.fail);