You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>require('esprima').parse('x = { __proto__: null, get __proto__(){} }')
Actual output:
Error: Line 1: Duplicate __proto__ fields are not allowed in object literals
Expected: a parse tree since the code is valid. It is a __proto__ property for the first and a getter function for the second, hence there is no duplicate.
See Annex B.3.1:
It is a Syntax Error if PropertyNameList of PropertyDefinitionList contains any duplicate entries for __proto__ and at least two of those entries were obtained from productions of the form PropertyDefinition : PropertyName : AssignmentExpression.
Thus, other productions such as MethodDefinition (for methods, setters, getters, generators, ..) should not be checked.
The text was updated successfully, but these errors were encountered:
…ropertyName.
Other PropertyDefinition productions, such as MethodDefinition and
IdentifierReference, should be excluded from duplicated __proto_ checks.
Fixesjquery#1225
Test case:
Actual output:
Expected: a parse tree since the code is valid. It is a
__proto__
property for the first and a getter function for the second, hence there is no duplicate.See Annex B.3.1:
Thus, other productions such as MethodDefinition (for methods, setters, getters, generators, ..) should not be checked.
The text was updated successfully, but these errors were encountered: