From bfb82e778fea5b766e18066a68f79ae3fbbab9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 11 Jan 2020 17:56:07 -0500 Subject: [PATCH] docs: add comments for ExpressionErrors.doubleProto [ci-skip] --- packages/babel-parser/src/parser/util.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js index ee420b7ab96b..ceb42ef5a410 100644 --- a/packages/babel-parser/src/parser/util.js +++ b/packages/babel-parser/src/parser/util.js @@ -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;