Skip to content

Commit

Permalink
chore: fix some comments (#4937)
Browse files Browse the repository at this point in the history
Fixture for some English comments in syntax.

Co-authored-by: Maledong <maledong_github@outlook.com>
  • Loading branch information
SEWeiTung and Maledong authored Apr 27, 2022
1 parent b0c17fd commit e31c09c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Application extends EggApplication {
if (typeof this.config.onClientError === 'function') {
const p = eggUtils.callFn(this.config.onClientError, [ err, socket, this ]);

// the returned object should like:
// the returned object should be something like:
//
// {
// body: '...',
Expand Down
4 changes: 2 additions & 2 deletions lib/core/dnscache_httpclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class DNSCacheHttpClient extends HttpClient {

args = args || {};
args.headers = args.headers || {};
// set host header is not exists
// set when host header doesn't exist
if (!args.headers.host && !args.headers.Host) {
// host must combine with hostname:port, node won't use `parsed.host`
args.headers.host = parsed.port ? `${hostname}:${parsed.port}` : hostname;
Expand All @@ -81,7 +81,7 @@ class DNSCacheHttpClient extends HttpClient {
const now = Date.now();
if (record) {
if (now - record.timestamp >= this.dnsCacheLookupInterval) {
// make sure next request don't refresh dns query
// make sure the next request doesn't refresh dns query
record.timestamp = now;
this[UPDATE_DNS](hostname, args).catch(err => this.app.emit('error', err));
}
Expand Down
4 changes: 2 additions & 2 deletions test/app/extend/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ describe('test/app/extend/request.test.js', () => {
expectQueries('a[]=&a[]=b&a=foo', { 'a[]': [ '', 'b' ], a: [ 'foo' ] });
expectQueries('a=bar&a[]=&a[]=b&a=foo', { 'a[]': [ '', 'b' ], a: [ 'bar', 'foo' ] });

// a[][] 这种不支持自动变化为 a
// 'a[][]' doesn't support converting to 'a'
expectQueries('a[][]=&a[][]=b', { 'a[][]': [ '', 'b' ] });
expectQueries('a][]=&a][]=b', { 'a][]': [ '', 'b' ] });
expectQueries('a[[]=&a[[]=b', { 'a[[]': [ '', 'b' ] });
expectQueries('[]=&[]=b', { '[]': [ '', 'b' ] });

// a[], a 混搭的时候,只返回最后一个 a 的值
// 'a[]' only returns the last value when mixed with others
expectQueries('a[]=a&a=b&a=c', { 'a[]': [ 'a' ], a: [ 'b', 'c' ] });

// object
Expand Down
2 changes: 1 addition & 1 deletion test/async/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)\./)[1]);
// only node >= 7.6 support async function without flags
// only node >= 7.6 supports async function without flags
if (nodeVersion >= 7.6) {
require('./_async');
}
2 changes: 1 addition & 1 deletion test/bench/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ app.ready().then(() => {
console.log('app(%s) ready', app.config.baseDir);

const server = http.createServer(app.callback());
// emit server event just like egg-cluster does
// emit server event just like egg-cluster
// https://github.com/eggjs/egg-cluster/blob/master/lib/app_worker.js#L52
app.emit('server', server);

Expand Down
4 changes: 2 additions & 2 deletions test/lib/application.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('test/lib/application.test.js', () => {
assert(err.message === 'Please set config.keys first');
}

// make sure app close
// make sure app closed
await app.close();
});

Expand All @@ -96,7 +96,7 @@ describe('test/lib/application.test.js', () => {
assert(err.message === 'Please set config.keys first');
}

// make sure app close
// make sure app closed
await app.close();
});

Expand Down

1 comment on commit e31c09c

@vercel
Copy link

@vercel vercel bot commented on e31c09c Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

egg – ./

egg-suyi.vercel.app
www.eggjs.org
eggjs.org
egg-pi.vercel.app
egg-git-master-suyi.vercel.app

Please sign in to comment.