* Sets the initial window size * * @param {{width: number, height: number}} size The desired window size. * @return {!Options} A self reference. * @throws {TypeError} if width or height is unspecified, not a number, or * less than or equal to 0.
({ width, height })
| 217 | * less than or equal to 0. |
| 218 | */ |
| 219 | windowSize({ width, height }) { |
| 220 | function checkArg(arg) { |
| 221 | if (typeof arg !== 'number' || arg <= 0) { |
| 222 | throw TypeError('Arguments must be {width, height} with numbers > 0') |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | checkArg(width) |
| 227 | checkArg(height) |
| 228 | return this.addArguments(`--width=${width}`, `--height=${height}`) |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * @param {string} key the preference key. |