Commit Graph

21 Commits

Author SHA1 Message Date
Guangcong Luo
4db67f3cca Report crashes in Dev
Currently, only crashes that require a server restart are reported
outside of the crash emailer and stdout. This makes it so all crashes
are reported.
2016-10-03 03:18:22 -07:00
Florian
60c2f98589 Fix errors being logged as ${stack} in errors.txt (#2729) 2016-08-30 12:50:42 -05:00
Guangcong Luo
54b672fe4e Start refactoring for template strings
This commit introduces Tools.html and Tools.plural, helper functions
for string construction.

Tools.html is a template tag function that escapes HTML inside the
template string.

Tools.plural is a helper function that takes a passed Number, Array,
Set, or Map and returns a string representing whether or not it's
plural.

It also starts doing some refactors of some files to make it clear how
I expect code style for template strings to look.

Previously, we used ' for IDs, " for English text, and ' for code.

We should now be using ' for IDs, ` for English text, and ` for code.
2016-08-28 04:35:43 -05:00
Guangcong Luo
b665660608 Refactor for more ES6 features
Now that nodejs/node#3072 is mostly fixed, we can finally start using
Node 4+ features.

This refactor:

- uses arrow functions where appropriate

  Note that arrow functions still aren't used in Mocha, where `this`
  is sometimes meaningful.

  This also removes the need for .bind() nearly everywhere, as well
  as the `self = this` trick.

- refactors Validator and Connection into ES6 classes

- no longer uses Array#forEach for iterating arrays

  We strongly prefer for (let i = 0; i < arr.length; i++) because of
  performance reasons. Most forEaches have been replaced with for..of,
  though, which is 5x slower than the long-form loop but 2x faster
  than forEach, which is good enough outside of most inner loops.

  The only exception is tournaments, which is due for a more invasive
  refactor soon anyway.
2016-02-10 17:40:21 -06:00
Guangcong Luo
8a8838552d Improve crashlogger
Crashlogger now supports passing in a dictionary of additional
information to report, so we no longer need to resort to making fake
errors.

The hadException parameter has now been removed entirely. I don't know
of a use case for it to be false.
2016-02-04 03:04:05 -06:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Ivo Julca
47918a6d92 Replace remaining instances of var by block bindings 2015-12-03 19:45:35 -05:00
Ivo Julca
8619ba2022 Turn on strict mode globally for real 2015-11-08 15:38:15 -05:00
Ivo Julca
8cbfea7f69 Crashlogger: include whether the process had an uncaught exception in emails
This is relevant information as some crashes may only happen after some other crash
has created inconsistent state either in PS itself or in Node.js internals.
2015-09-10 22:41:53 -05:00
Ivo Julca
4222ffb5df Dependant support: make sure that relative paths are resolved properly 2015-05-11 15:38:18 -05:00
Ivo Julca
253c2b951e Update dependencies 2015-02-23 04:14:30 -05:00
Guangcong Luo
be2caed2f0 Properly report stack overflows 2014-08-30 23:08:06 -04:00
小太
5c8fc7b982 Space after function for anonymous functions 2014-04-22 01:58:16 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00
Slayer95
4c18aa60f1 Remove global 'fs' 2014-04-17 14:37:32 -05:00
Slayer95
75559362b4 Rename global config to Config 2014-04-17 01:12:28 -04:00
Tyler Stark
bff353cc58 Second Pass at cleaning up the code. These are pretty safe edits that include adding 0 to decimal values, fixing variables that are declared multiple times, and removing duplicate keys 2014-02-09 23:38:57 -06:00
Guangcong Luo
c9a6d5d809 Crashes written to the console now specify crash type 2013-07-26 13:45:50 -07:00
Guangcong Luo
27be062395 Tons of documentation 2013-05-24 14:59:29 -07:00
Cathy J. Fitzpatrick
d5fe9bc807 Fix not locking down server if process has been running > 1 hour 2013-04-30 00:17:42 -06:00
Cathy J. Fitzpatrick
1512f38db9 Actually commit crashlogger.js 2013-04-25 00:15:54 -06:00