Small fixes to jsdoc (#140)

References #65.
This commit is contained in:
JoelEinbinder 2017-07-26 09:58:03 -07:00 committed by Andrey Lushnikov
parent 81d4b8f4f8
commit 9363a15cce
4 changed files with 7 additions and 3 deletions

View File

@ -31,7 +31,7 @@ class Connection extends EventEmitter {
this._port = port; this._port = port;
this._targetId = targetId; this._targetId = targetId;
this._lastId = 0; this._lastId = 0;
/** @type {!Map<number, {resolve: function(*), reject: function(*), method: string}>}*/ /** @type {!Map<number, {resolve: function, reject: function, method: string}>}*/
this._callbacks = new Map(); this._callbacks = new Map();
this._ws = ws; this._ws = ws;

View File

@ -115,7 +115,7 @@ class FrameManager extends EventEmitter {
// Detach all child frames first. // Detach all child frames first.
for (let child of frame.childFrames()) for (let child of frame.childFrames())
this._removeFramesRecursively(child); this._removeFramesRecursively(child);
this._frames.delete(frame._id, frame); this._frames.delete(frame._id);
// Update frame id to retain frame identity. // Update frame id to retain frame identity.
frame._id = newFramePayload.id; frame._id = newFramePayload.id;
@ -305,6 +305,7 @@ class Frame {
} }
/** /**
* @template T
* @param {string} selector * @param {string} selector
* @param {function(!Element):T} pageFunction * @param {function(!Element):T} pageFunction
* @param {!Array<*>} args * @param {!Array<*>} args
@ -322,6 +323,7 @@ class Frame {
} }
/** /**
* @template T
* @param {string} selector * @param {string} selector
* @param {function(!Element):T} pageFunction * @param {function(!Element):T} pageFunction
* @param {!Array<*>} args * @param {!Array<*>} args

View File

@ -599,6 +599,7 @@ class Page extends EventEmitter {
} }
/** /**
* @template T
* @param {string} selector * @param {string} selector
* @param {function(!Element):T} pageFunction * @param {function(!Element):T} pageFunction
* @param {!Array<*>} args * @param {!Array<*>} args
@ -609,6 +610,7 @@ class Page extends EventEmitter {
} }
/** /**
* @template T
* @param {string} selector * @param {string} selector
* @param {function(!Element):T} pageFunction * @param {function(!Element):T} pageFunction
* @param {!Array<*>} args * @param {!Array<*>} args

View File

@ -306,7 +306,7 @@ describe('Puppeteer', function() {
expect(found).toBe(true); expect(found).toBe(true);
})); }));
it('should timeout', SX(async function() { it('should timeout', SX(async function() {
startTime = Date.now(); let startTime = Date.now();
const timeout = 42; const timeout = 42;
await page.waitFor(timeout); await page.waitFor(timeout);
expect(Date.now() - startTime).not.toBeLessThan(timeout / 2); expect(Date.now() - startTime).not.toBeLessThan(timeout / 2);