Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refactor: rename private method name to symbol (#904)
  • Loading branch information
iyuq authored and dead-horse committed May 13, 2017
1 parent 8115c57 commit fac3e0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/application.js
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

0 comments on commit fac3e0c

Please sign in to comment.