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

refactor: rename private method name to symbol #904

Merged
merged 1 commit into from
May 13, 2017
Merged
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
10 changes: 6 additions & 4 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const KEYS = Symbol('Application#keys');
const HELPER = Symbol('Application#Helper');
const LOCALS = Symbol('Application#locals');
const LOCALS_LIST = Symbol('Application#localsList');
const BIND_EVENTS = Symbol('Application#bindEvents');
const WARN_CONFUSED_CONFIG = Symbol('Application#warnConfusedConfig');
const EGG_LOADER = Symbol.for('egg#loader');
const EGG_PATH = Symbol.for('egg#eggPath');
const CLUSTER_CLIENTS = Symbol.for('egg#clusterClients');
Expand Down Expand Up @@ -40,8 +42,8 @@ class Application extends EggApplication {

// dump config after loaded, ensure all the dynamic modifications will be recorded
this.dumpConfig();
this.warnConfusedConfig();
this.bindEvents();
this[WARN_CONFUSED_CONFIG]();
this[BIND_EVENTS]();
}

get [EGG_LOADER]() {
Expand Down Expand Up @@ -203,7 +205,7 @@ class Application extends EggApplication {
*
* @private
*/
bindEvents() {
[BIND_EVENTS]() {
// Browser Cookie Limits: http://browsercookielimits.squawky.net/
this.on('cookieLimitExceed', ({ name, value, ctx }) => {
const err = new Error(`cookie ${name}'s length(${value.length}) exceed the limit(4093)`);
Expand All @@ -220,7 +222,7 @@ class Application extends EggApplication {
*
* @private
*/
warnConfusedConfig() {
[WARN_CONFUSED_CONFIG]() {
const confusedConfigurations = this.config.confusedConfigurations;
Object.keys(confusedConfigurations).forEach(key => {
if (this.config[key] !== undefined) {
Expand Down