constructor( driver, expectedElementSelector, waitMS = 30000 ) { this.name = this.constructor.name; this.driver = driver; this.expectedElementSelector = expectedElementSelector; this.explicitWaitMS = waitMS; }
/** * Run async function in the background * @see Context#runInBackground * @param {Function} scope - the first args is an anonymous ctx */ runInBackground(scope) { const ctx = this.createAnonymousContext(); if (!scope.name) scope._name = eggUtils.getCalleeFromStack(true); ctx.runInBackground(scope); }
get options() { return { ...(this.defaultOptions || {}), ...((this.polly.config.adapterOptions || {})[this.constructor.id] || {}) }; }
/** * Determine if the given buffer is utf8. * @param {Buffer} buffer */ export default function isBufferUtf8Representable(buffer) { const utfEncodedBuffer = buffer.toString('utf8'); const reconstructedBuffer = Buffer.from(utfEncodedBuffer, 'utf8'); return reconstructedBuffer.equals(buffer); }
document.attachEvent('onreadystatechange', function () { if (document.readyState == "complete") { document.detachEvent("onreadystatechange", arguments.callee); callback(); } })
constructor(code, result, query, values) { const message = errorMessages[code].message; super(message); this.name = this.constructor.name; this.code = code; this.result = result; this.query = query; this.values = values; this.received = result.rows.length; Error.captureStackTrace(this, this.constructor); }
/** * @abstract * @param {Object} ast * @param {String[]} retArr * @returns {String[]} */ astFunction(ast, retArr) { throw new Error(`"astFunction" not defined on ${ this.constructor.name }`); }
constructor(error, ps) { const isQueryFileError = error instanceof QueryFileError; const message = isQueryFileError ? `Failed to initialize 'text' from a QueryFile.` : error; super(message); this.name = this.constructor.name; if (isQueryFileError) { this.error = error; } this.result = ps; Error.captureStackTrace(this, this.constructor); }
/** * @abstract * @return {Object} */ initCanvas() { throw new Error(`"initCanvas" not defined on ${ this.constructor.name }`); }
/** * @desc Validate settings * @abstract */ validateSettings() { throw new Error(`"validateSettings" not defined on ${ this.constructor.name }`); }
/** * Used for when we want a string output of our kernel, so we can still input values to the kernel */ getStringValueHandler() { throw new Error(`"getStringValueHandler" not implemented on ${this.constructor.name}`); }
/** * @desc Deletes the Texture */ delete() { throw new Error(`Not implemented on ${this.constructor.name}`); }