Skip to content

Commit

Permalink
fixes trullock#360
Browse files Browse the repository at this point in the history
  • Loading branch information
trullock committed May 11, 2023
1 parent 629d6b0 commit 18b777d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v1.20.7 (11 May 2023)
- Fixes bug with export async

## v1.20.6 (4 April 2023)
- Fixes bug with delete keyword

Expand Down
7 changes: 7 additions & 0 deletions src/NUglify.Tests/JavaScript/Bugs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,12 @@ public void Bug353()
{
TestHelper.Instance.RunErrorTest();
}

[Test]
public void Bug360()
{
TestHelper.Instance.RunTest("-rename:all");
}

}
}
6 changes: 6 additions & 0 deletions src/NUglify.Tests/NUglify.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@
<Content Include="TestData\JS\Expected\Bugs\Bug300.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\JS\Expected\Bugs\Bug360.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\JS\Expected\Bugs\Bug70.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2866,6 +2869,9 @@
<Content Include="TestData\JS\Input\Bugs\Bug138.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\JS\Input\Bugs\Bug360.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\JS\Input\Bugs\Bug298.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
1 change: 1 addition & 0 deletions src/NUglify.Tests/TestData/JS/Expected/Bugs/Bug360.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export async function fooAsync(){}
1 change: 1 addition & 0 deletions src/NUglify.Tests/TestData/JS/Input/Bugs/Bug360.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export async function fooAsync(){}
2 changes: 1 addition & 1 deletion src/NUglify/JavaScript/JSParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2483,7 +2483,7 @@ private AstNode ParseExport()
KeywordContext = m_currentToken.Clone(),
};
GetNextToken();
if (m_currentToken.IsOne(JSToken.Var, JSToken.Const, JSToken.Let, JSToken.Function, JSToken.Class))
if (m_currentToken.IsOne(JSToken.Var, JSToken.Const, JSToken.Let, JSToken.Async, JSToken.Function, JSToken.Class))
{
// export var/const/let/funcdecl/classdecl
var declaration = ParseStatement(true, true);
Expand Down
2 changes: 1 addition & 1 deletion src/NUglify/NUglify.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/trullock/NUglify</RepositoryUrl>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<Version>1.20.6</Version>
<Version>1.20.7</Version>
<PackageLicenseExpression></PackageLicenseExpression>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down

0 comments on commit 18b777d

Please sign in to comment.