Skip to content

Commit d943ee2

Browse files
thorn0jleyba
authored andcommitted
[js] fix doc typos (#3133)
1 parent 2d3cdc6 commit d943ee2

11 files changed

Lines changed: 50 additions & 51 deletions

File tree

javascript/node/selenium-webdriver/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var seleniumServer;
5858
* Starts an instance of the Selenium server if not yet running.
5959
* @param {string} jar Path to the server jar to use.
6060
* @return {!Promise<string>} A promise for the server's
61-
* addrss once started.
61+
* address once started.
6262
*/
6363
function startSeleniumServer(jar) {
6464
if (!seleniumServer) {
@@ -160,7 +160,7 @@ function createDriver(ctor, ...args) {
160160
/** @override */
161161
this.catch = pd.then.bind(pd);
162162
}
163-
}
163+
};
164164
promise.CancellableThenable.addImplementation(thenableWebDriverProxy);
165165
THENABLE_DRIVERS.set(ctor, thenableWebDriverProxy);
166166
}

javascript/node/selenium-webdriver/lib/actions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class ActionSequence {
333333
/**
334334
* Performs a modifier key press. The modifier key is <em>not released</em>
335335
* until {@link #keyUp} or {@link #sendKeys} is called. The key press will be
336-
* targetted at the currently focused element.
336+
* targeted at the currently focused element.
337337
*
338338
* @param {!input.Key} key The modifier key to push. Must be one of
339339
* {ALT, CONTROL, SHIFT, COMMAND, META}.
@@ -347,7 +347,7 @@ class ActionSequence {
347347
}
348348

349349
/**
350-
* Performs a modifier key release. The release is targetted at the currently
350+
* Performs a modifier key release. The release is targeted at the currently
351351
* focused element.
352352
* @param {!input.Key} key The modifier key to release. Must be one of
353353
* {ALT, CONTROL, SHIFT, COMMAND, META}.
@@ -363,7 +363,7 @@ class ActionSequence {
363363
/**
364364
* Simulates typing multiple keys. Each modifier key encountered in the
365365
* sequence will not be released until it is encountered again. All key events
366-
* will be targetted at the currently focused element.
366+
* will be targeted at the currently focused element.
367367
*
368368
* @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args
369369
* The keys to type.

javascript/node/selenium-webdriver/lib/by.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class By {
153153
}
154154

155155
/**
156-
* Locates eleemnts by the ID attribute. This locator uses the CSS selector
156+
* Locates elements by the ID attribute. This locator uses the CSS selector
157157
* `*[id="$ID"]`, _not_ `document.getElementById`.
158158
*
159159
* @param {string} id The ID to search for.

javascript/node/selenium-webdriver/lib/capabilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const Capability = {
103103
*/
104104
PROXY: 'proxy',
105105

106-
/** Whether the driver supports changing the brower's orientation. */
106+
/** Whether the driver supports changing the browser's orientation. */
107107
ROTATABLE: 'rotatable',
108108

109109
/**

javascript/node/selenium-webdriver/lib/error.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class UnknownMethodError extends WebDriverError {
311311

312312

313313
/**
314-
* Reports an unsupport operation.
314+
* Reports an unsupported operation.
315315
*/
316316
class UnsupportedOperationError extends WebDriverError {
317317
/** @param {string=} opt_error the error message, if any. */
@@ -465,7 +465,7 @@ function checkResponse(data) {
465465

466466
/**
467467
* Throws an error coded from the W3C protocol. A generic error will be thrown
468-
* if the privded `data` is not a valid encoded error.
468+
* if the provided `data` is not a valid encoded error.
469469
*
470470
* @param {{error: string, message: string}} data The error data to decode.
471471
* @throws {WebDriverError} the decoded error.

javascript/node/selenium-webdriver/lib/events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class Listener {
2424
/**
25-
* @param {!Function} fn The acutal listener function.
25+
* @param {!Function} fn The actual listener function.
2626
* @param {(Object|undefined)} scope The object in whose scope to invoke the
2727
* listener.
2828
* @param {boolean} oneshot Whether this listener should only be used once.

javascript/node/selenium-webdriver/lib/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ class Executor {
438438
}
439439

440440
// The remote end is a W3C compliant server if there is no `status`
441-
// field in the response. This is not appliable for the DESCRIBE_SESSION
441+
// field in the response. This is not applicable for the DESCRIBE_SESSION
442442
// command, which is not defined in the W3C spec.
443443
if (command.getName() === cmd.Name.NEW_SESSION) {
444444
this.w3c = this.w3c || !('status' in parsed);

javascript/node/selenium-webdriver/lib/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class FileDetector {
144144
/**
145145
* Handles the file specified by the given path, preparing it for use with
146146
* the current browser. If the path does not refer to a valid file, it will
147-
* be returned unchanged, otherwisee a path suitable for use with the current
147+
* be returned unchanged, otherwise a path suitable for use with the current
148148
* browser will be returned.
149149
*
150150
* This default implementation is a no-op. Subtypes may override this function

javascript/node/selenium-webdriver/lib/promise.js

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* > e => console.error('FAILURE: ' + e));
4949
* > ```
5050
* >
51-
* > The motiviation behind this change and full deprecation plan are documented
51+
* > The motivation behind this change and full deprecation plan are documented
5252
* > in [issue 2969](https://github.com/SeleniumHQ/selenium/issues/2969).
5353
* >
5454
* >
@@ -87,8 +87,7 @@
8787
* The control flow is based on the concept of tasks and task queues. Tasks are
8888
* functions that define the basic unit of work for the control flow to execute.
8989
* Each task is scheduled via {@link ControlFlow#execute()}, which will return
90-
* a {@link ManagedPromise ManagedPromise} that will be resolved with the task's
91-
* result.
90+
* a {@link ManagedPromise} that will be resolved with the task's result.
9291
*
9392
* A task queue contains all of the tasks scheduled within a single turn of the
9493
* [JavaScript event loop][JSEL]. The control flow will create a new task queue
@@ -123,7 +122,7 @@
123122
*
124123
* ## Task Execution
125124
*
126-
* Upon creating a task queue, and whenever an exisiting queue completes a task,
125+
* Upon creating a task queue, and whenever an existing queue completes a task,
127126
* the control flow will schedule a microtask timer to process any scheduled
128127
* tasks. This ensures no task is ever started within the same turn of the
129128
* JavaScript event loop in which it was scheduled, nor is a task ever started
@@ -140,13 +139,13 @@
140139
* discarded and the task's promised result (previously returned by
141140
* {@link ControlFlow#execute()}) is immediately rejected with the thrown
142141
* error.
143-
* 3. The task function returns sucessfully.
142+
* 3. The task function returns successfully.
144143
*
145144
* If a task function created a new task queue, the control flow will wait for
146145
* that queue to complete before processing the task result. If the queue
147146
* completes without error, the flow will settle the task's promise with the
148-
* value originaly returned by the task function. On the other hand, if the task
149-
* queue termintes with an error, the task's promise will be rejected with that
147+
* value originally returned by the task function. On the other hand, if the task
148+
* queue terminates with an error, the task's promise will be rejected with that
150149
* error.
151150
*
152151
* flow.execute(function() {
@@ -161,7 +160,7 @@
161160
* ## ManagedPromise Integration
162161
*
163162
* In addition to the {@link ControlFlow} class, the promise module also exports
164-
* a [Promise/A+] {@linkplain ManagedPromise implementation} that is deeply
163+
* a [Promises/A+] {@linkplain ManagedPromise implementation} that is deeply
165164
* integrated with the ControlFlow. First and foremost, each promise
166165
* {@linkplain ManagedPromise#then() callback} is scheduled with the
167166
* control flow as a task. As a result, each callback is invoked in its own turn
@@ -328,7 +327,7 @@
328327
* Even though a subtask's promised result will never resolve while the task
329328
* function is on the stack, it will be treated as a promise resolved within the
330329
* task. In all other scenarios, a task's promise behaves just like a normal
331-
* promise. In the sample below, `C/D` is loggged before `B` because the
330+
* promise. In the sample below, `C/D` is logged before `B` because the
332331
* resolution of `subtask1` interrupts the flow of the enclosing task. Within
333332
* the final subtask, `E/F` is logged in order because `subtask1` is a resolved
334333
* promise when that task runs.
@@ -582,9 +581,9 @@
582581
*
583582
* Bottom line: you __*must*__ handle rejected promises.
584583
*
585-
* # Promise/A+ Compatibility
584+
* # Promises/A+ Compatibility
586585
*
587-
* This `promise` module is compliant with the [Promise/A+] specification
586+
* This `promise` module is compliant with the [Promises/A+] specification
588587
* except for sections `2.2.6.1` and `2.2.6.2`:
589588
*
590589
* >
@@ -623,7 +622,7 @@
623622
*
624623
* [JSEL]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop
625624
* [GF]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
626-
* [Promise/A+]: https://promisesaplus.com/
625+
* [Promises/A+]: https://promisesaplus.com/
627626
* [MicrotasksArticle]: https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
628627
*/
629628

@@ -943,7 +942,7 @@ class Thenable {
943942

944943
/**
945944
* Marker interface for objects that allow consumers to request the cancellation
946-
* of a promies-based operation. A cancelled promise will be rejected with a
945+
* of a promise-based operation. A cancelled promise will be rejected with a
947946
* {@link CancellationError}.
948947
*
949948
* This interface is considered package-private and should not be used outside
@@ -1309,7 +1308,7 @@ class ManagedPromise {
13091308
* @param {!Function} fn The function to use as the top of the stack when
13101309
* recording the callback's creation point.
13111310
* @return {!ManagedPromise<R>} A new promise which will be resolved with the
1312-
* esult of the invoked callback.
1311+
* result of the invoked callback.
13131312
* @template R
13141313
* @private
13151314
*/
@@ -1974,7 +1973,7 @@ class Scheduler {
19741973
/**
19751974
* Schedules a task to wait for a condition to hold.
19761975
*
1977-
* If the condition is defined as a function, it may return any value. Promies
1976+
* If the condition is defined as a function, it may return any value. Promise
19781977
* will be resolved before testing if the condition holds (resolution time
19791978
* counts towards the timeout). Once resolved, values are always evaluated as
19801979
* booleans.
@@ -1998,7 +1997,7 @@ class Scheduler {
19981997
* @param {string=} opt_message An optional error message to include if the
19991998
* wait times out; defaults to the empty string.
20001999
* @return {!Thenable<T>} A promise that will be fulfilled
2001-
* when the condition has been satisified. The promise shall be rejected
2000+
* when the condition has been satisfied. The promise shall be rejected
20022001
* if the wait times out waiting for the condition.
20032002
* @throws {TypeError} If condition is not a function or promise or if timeout
20042003
* is not a number >= 0.
@@ -2041,7 +2040,7 @@ function createPromise(resolver) {
20412040
* @param {string=} opt_message An optional error message to include if the
20422041
* wait times out; defaults to the empty string.
20432042
* @return {!Thenable<T>} A promise that will be fulfilled
2044-
* when the condition has been satisified. The promise shall be rejected
2043+
* when the condition has been satisfied. The promise shall be rejected
20452044
* if the wait times out waiting for the condition.
20462045
* @throws {TypeError} If condition is not a function or promise or if timeout
20472046
* is not a number >= 0.
@@ -2165,7 +2164,7 @@ const SIMPLE_SCHEDULER = new SimpleScheduler;
21652164
/**
21662165
* Handles the execution of scheduled tasks, each of which may be an
21672166
* asynchronous operation. The control flow will ensure tasks are executed in
2168-
* the ordered scheduled, starting each task only once those before it have
2167+
* the order scheduled, starting each task only once those before it have
21692168
* completed.
21702169
*
21712170
* Each task scheduled within this flow may return a {@link ManagedPromise} to
@@ -2213,7 +2212,7 @@ class ControlFlow extends events.EventEmitter {
22132212
this.taskQueues_ = null;
22142213

22152214
/**
2216-
* Micro task that controls shutting down the control flow. Upon shut down,
2215+
* Microtask that controls shutting down the control flow. Upon shut down,
22172216
* the flow will emit an
22182217
* {@link ControlFlow.EventType.IDLE} event. Idle events
22192218
* always follow a brief timeout in order to catch latent errors from the
@@ -2222,8 +2221,8 @@ class ControlFlow extends events.EventEmitter {
22222221
* by the promise system until the next turn of the event loop:
22232222
*
22242223
* // Schedule 1 task that fails.
2225-
* var result = promise.controlFlow().schedule('example',
2226-
* function() { return promise.rejected('failed'); });
2224+
* var result = promise.controlFlow().execute(
2225+
* () => promise.rejected('failed'), 'example');
22272226
* // Set a callback on the result. This delays reporting the unhandled
22282227
* // failure for 1 turn of the event loop.
22292228
* result.then(function() {});
@@ -2247,7 +2246,7 @@ class ControlFlow extends events.EventEmitter {
22472246
/**
22482247
* Returns a string representation of this control flow, which is its current
22492248
* {@linkplain #getSchedule() schedule}, sans task stack traces.
2250-
* @return {string} The string representation of this contorl flow.
2249+
* @return {string} The string representation of this control flow.
22512250
* @override
22522251
*/
22532252
toString() {
@@ -2890,7 +2889,7 @@ class TaskQueue extends events.EventEmitter {
28902889
}
28912890

28922891
// Now that all of the remaining tasks have been silently cancelled (e.g. no
2893-
// exisitng callbacks on those tasks will fire), clear the silence bit on
2892+
// existing callbacks on those tasks will fire), clear the silence bit on
28942893
// the cancellation error. This ensures additional callbacks registered in
28952894
// the future will actually execute.
28962895
cancellation.silent_ = false;
@@ -3069,7 +3068,7 @@ class TaskQueue extends events.EventEmitter {
30693068
}
30703069
return task;
30713070
}
3072-
};
3071+
}
30733072

30743073

30753074

@@ -3215,7 +3214,7 @@ function consume(generatorFn, opt_self, ...var_args) {
32153214

32163215
function pump(fn, opt_arg) {
32173216
if (ret instanceof ManagedPromise && !isPending(ret)) {
3218-
return; // Defererd was cancelled; silently abort.
3217+
return; // Deferred was cancelled; silently abort.
32193218
}
32203219

32213220
try {
@@ -3276,7 +3275,7 @@ module.exports = {
32763275
* The promise manager is currently enabled by default, but may be disabled
32773276
* by setting the environment variable `SELENIUM_PROMISE_MANAGER=0` or by
32783277
* setting this property to false. Setting this property will always take
3279-
* precedence ove the use of the environment variable.
3278+
* precedence over the use of the environment variable.
32803279
*
32813280
* @return {boolean} Whether the promise manager is enabled.
32823281
* @see <https://github.com/SeleniumHQ/selenium/issues/2969>

javascript/node/selenium-webdriver/lib/symbols.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
* available, the serialize method will return a promise that will be resolved
3131
* with the serialized form.
3232
*
33-
* Note that the described method is analgous to objects that define a
33+
* Note that the described method is analogous to objects that define a
3434
* `toJSON()` method, except the serialized result may be a promise, or
3535
* another object with a promised property.
3636
*/

0 commit comments

Comments
 (0)