Skip to content

Commit

Permalink
Catch 'eval' and 'arguments' in setter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Apr 22, 2023
1 parent 3db79f6 commit 17e6dc6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,14 @@ where
interner,
)?;

// Catch early error for BindingIdentifier.
if body.strict() && contains(&parameters, ContainsSymbol::EvalOrArguments) {
return Err(Error::lex(LexError::Syntax(
"unexpected identifier 'eval' or 'arguments' in strict mode".into(),
params_start_position,
)));
}

// It is a Syntax Error if FunctionBodyContainsUseStrict of FunctionBody is true
// and IsSimpleParameterList of PropertySetParameterList is false.
// https://tc39.es/ecma262/#sec-method-definitions-static-semantics-early-errors
Expand Down

0 comments on commit 17e6dc6

Please sign in to comment.