diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index 7386e6f2f3a..7249afd7328 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -154,6 +154,13 @@ module TypeScript.Parser { // TODO: do we need to store/restore this when speculative parsing? I don't think so. The // parsing logic already handles storing/restoring this and should work properly even if we're // speculative parsing. + // + // When adding more parser context flags, consider which is the more common case that the + // flag will be in. This should be hte 'false' state for that flag. The reason for this is + // that we don't store data in our nodes unless the value is in the *non-default* state. So, + // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for + // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost + // all nodes would need extra state on them to store this info. var strictMode: boolean = false; var disallowIn: boolean = false;