Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codespell action #89

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on: [push, pull_request]
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: ./.git
ignore_words_list: "process'"
14 changes: 7 additions & 7 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function defaultClearTimeout () {
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
//normal environments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
Expand All @@ -46,14 +46,14 @@ function runTimeout(fun) {
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
// when when somebody has screwed with setTimeout but no I.E. madness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
// same as above but when it's a version of I.E. that must have the global object for 'this', hopefully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
Expand All @@ -62,7 +62,7 @@ function runTimeout(fun) {
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
//normal environments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
Expand All @@ -71,14 +71,14 @@ function runClearTimeout(marker) {
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
// when when somebody has screwed with setTimeout but no I.E. madness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// same as above but when it's a version of I.E. that must have the global object for 'this', hopefully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
Expand Down Expand Up @@ -144,7 +144,7 @@ process.nextTick = function (fun) {
}
};

// v8 likes predictible objects
// v8 likes predictable objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
Expand Down
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function test (ourProcess) {
}, 1);
ourProcess.nextTick(function (num) {

assert.equal(num, order++, '3rd schedualed happens after the error');
assert.equal(num, order++, '3rd scheduled happens after the error');
}, 2);
});
});
Expand All @@ -45,7 +45,7 @@ if (!process.browser) {
process.once('uncaughtException', function(err) {
assert.equal(2, order++, 'error is third');
ourProcess.nextTick(function () {
assert.equal(5, order++, 'schedualed in error is last');
assert.equal(5, order++, 'scheduled in error is last');
done();
});
});
Expand All @@ -60,7 +60,7 @@ if (!process.browser) {
throw(new Error('an error is thrown'));
});
ourProcess.nextTick(function () {
assert.equal(3, order++, '3rd schedualed happens after the error');
assert.equal(3, order++, '3rd scheduled happens after the error');
});
});
});
Expand Down