Skip to content

Commit

Permalink
Minor correction
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed May 31, 2024
1 parent ee2ded5 commit ff8989a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Acornima/Helpers/StringPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public string GetOrCreate(ReadOnlySpan<char> value)
int count = _count;
if (count == entries!.Length)
{
Resize(checked(_count + _count / 2));
Resize(checked(_count + (_count >> 1)));
bucket = ref GetBucketRef(hashCode);
}
index = count;
Expand Down
3 changes: 1 addition & 2 deletions src/Acornima/Parser.Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,6 @@ private StatementOrExpression ParseFunctionBody(Identifier? id, in NodeList<Node
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/expression.js > `pp.parseFunctionBody = function`

expression = isArrowFunction && _tokenizer._type != TokenType.BraceLeft;
var strict = false;

StatementOrExpression body;
if (expression)
Expand All @@ -1707,7 +1706,7 @@ private StatementOrExpression ParseFunctionBody(Identifier? id, in NodeList<Node
var oldStrict = _strict;
Expect(TokenType.BraceLeft);
var statements = ParseDirectivePrologue(allowStrictDirective: !nonSimple);
strict = _strict;
var strict = _strict;

// Add the params to varDeclaredNames to ensure that an error is thrown
// if a let/const declaration in the function clashes with one of the params.
Expand Down
2 changes: 1 addition & 1 deletion src/Acornima/Parser.Statement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ private Statement ParseForInOf(in Marker startMarker, bool isForIn, bool await,

VariableDeclarator? variableDeclarator;
if (init is VariableDeclaration variableDeclaration
&& (variableDeclarator = variableDeclaration.Declarations[0]).Init is { } variableInitializer)
&& (variableDeclarator = variableDeclaration.Declarations[0]).Init is not null)
{
if (!isForIn
|| _tokenizerOptions._ecmaVersion < EcmaVersion.ES8
Expand Down

0 comments on commit ff8989a

Please sign in to comment.