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
Copy file name to clipboardExpand all lines: test/Acornima.Tests/ParserTests.cs
+143Lines changed: 143 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -814,6 +814,149 @@ public void ShouldHandleStrictModeDetectionEdgeCases(string input, bool isModule
814
814
}
815
815
}
816
816
817
+
[Theory]
818
+
[InlineData("script","(class { x = () => arguments })",EcmaVersion.Latest,"'arguments' is not allowed in class field initializer or static initialization block")]
819
+
[InlineData("script","() => { (class { x = () => arguments }) }",EcmaVersion.Latest,"'arguments' is not allowed in class field initializer or static initialization block")]
820
+
[InlineData("script","() => class { x = () => { arguments } }",EcmaVersion.Latest,"'arguments' is not allowed in class field initializer or static initialization block")]
821
+
[InlineData("script","() => class { x = function() { arguments } }",EcmaVersion.Latest,null)]
[InlineData("script","(class { x = async () => await 1 })",EcmaVersion.Latest,null)]
896
+
[InlineData("module","(class { x = async () => await 1 })",EcmaVersion.Latest,null)]
897
+
898
+
[InlineData("script","() => class { x = await }",EcmaVersion.Latest,null)]
899
+
[InlineData("module","() => class { x = await }",EcmaVersion.Latest,"Unexpected reserved word")]
900
+
[InlineData("script","() => class { x = await 1 }",EcmaVersion.Latest,"await is only valid in async functions and the top level bodies of modules")]
901
+
[InlineData("module","() => class { x = await 1 }",EcmaVersion.Latest,"Unexpected reserved word")]
902
+
903
+
[InlineData("script","() => class { x = () => await }",EcmaVersion.Latest,null)]
904
+
[InlineData("module","() => class { x = () => await }",EcmaVersion.Latest,"Unexpected reserved word")]
905
+
[InlineData("script","() => class { x = () => await 1 }",EcmaVersion.Latest,"await is only valid in async functions and the top level bodies of modules")]
906
+
[InlineData("module","() => class { x = () => await 1 }",EcmaVersion.Latest,"Unexpected reserved word")]
907
+
908
+
[InlineData("script","() => class { x = async () => await }",EcmaVersion.Latest,"Unexpected token '}'")]
909
+
[InlineData("module","() => class { x = async () => await }",EcmaVersion.Latest,"Unexpected token '}'")]
910
+
[InlineData("script","() => class { x = async () => await 1 }",EcmaVersion.Latest,null)]
911
+
[InlineData("module","() => class { x = async () => await 1 }",EcmaVersion.Latest,null)]
912
+
913
+
[InlineData("script","async () => class { x = await }",EcmaVersion.Latest,null)]
914
+
[InlineData("module","async () => class { x = await }",EcmaVersion.Latest,"Unexpected reserved word")]
915
+
[InlineData("script","async () => class { x = await 1 }",EcmaVersion.Latest,"Unexpected number")]
916
+
[InlineData("module","async () => class { x = await 1 }",EcmaVersion.Latest,"Unexpected reserved word")]
917
+
918
+
[InlineData("script","async () => class { x = () => await }",EcmaVersion.Latest,null)]
919
+
[InlineData("module","async () => class { x = () => await }",EcmaVersion.Latest,"Unexpected reserved word")]
920
+
[InlineData("script","async () => class { x = () => await 1 }",EcmaVersion.Latest,"Unexpected number")]
921
+
[InlineData("module","async () => class { x = () => await 1 }",EcmaVersion.Latest,"Unexpected reserved word")]
922
+
923
+
[InlineData("script","async () => class { x = async () => await }",EcmaVersion.Latest,"Unexpected token '}'")]
924
+
[InlineData("module","async () => class { x = async () => await }",EcmaVersion.Latest,"Unexpected token '}'")]
925
+
[InlineData("script","async () => class { x = async () => await 1 }",EcmaVersion.Latest,null)]
926
+
[InlineData("module","async () => class { x = async () => await 1 }",EcmaVersion.Latest,null)]
927
+
928
+
[InlineData("script","async () => class { x = (a = await) => a }",EcmaVersion.Latest,null)]
929
+
[InlineData("module","async () => class { x = (a = await) => a }",EcmaVersion.Latest,"Unexpected reserved word")]
930
+
[InlineData("script","async () => class { x = (a = await 1) => a }",EcmaVersion.Latest,"Unexpected number")]
931
+
[InlineData("module","async () => class { x = (a = await 1) => a }",EcmaVersion.Latest,"Unexpected reserved word")]
932
+
933
+
[InlineData("script","async () => class { x = class await { y = await } }",EcmaVersion.Latest,null)]
934
+
[InlineData("module","async () => class { x = class await { y = await } }",EcmaVersion.Latest,"Unexpected reserved word")]
935
+
[InlineData("script","async () => class { x = class await { y = await 1 } }",EcmaVersion.Latest,"await is only valid in async functions and the top level bodies of modules")]
936
+
[InlineData("module","async () => class { x = class await { y = await 1 } }",EcmaVersion.Latest,"Unexpected reserved word")]
937
+
938
+
[InlineData("script","async () => class { x = () => { { try {} catch (await) { } } } }",EcmaVersion.Latest,null)]
0 commit comments