Skip to content

Commit

Permalink
docs: add comments for ExpressionErrors.doubleProto [ci-skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jan 11, 2020
1 parent 880891a commit bfb82e7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/babel-parser/src/parser/util.js
Expand Up @@ -286,10 +286,15 @@ export default class UtilParser extends Tokenizer {
}

/**
* The Expression Errors is a context struct used to track
* The ExpressionErrors is a context struct used to track
* - **shorthandAssign**: track initializer `=` position when parsing ambiguous
* patterns. When we are sure the parsed pattern is a RHS, we will throw on
* this position for invalid assign syntax, otherwise reset to -1
* patterns. When we are sure the parsed pattern is a RHS, which means it is
* not a pattern, we will throw on this position on invalid assign syntax,
* otherwise it will be reset to -1
* - **doubleProto**: track the duplicate `__proto__` key position when parsing
* ambiguous object patterns. When we are sure the parsed pattern is a RHS,
* which means it is an object literal, we will throw on this position for
* __proto__ redefinition, otherwise it will be reset to -1
*/
export class ExpressionErrors {
shorthandAssign = -1;
Expand Down

0 comments on commit bfb82e7

Please sign in to comment.