createPrivateIdentifier: names must start with # (#36506)

This commit is contained in:
Nathan Shively-Sanders
2020-01-29 10:11:30 -08:00
committed by GitHub
parent 0cf100dcf8
commit c42ef575be
2 changed files with 8 additions and 0 deletions

View File

@@ -46,3 +46,8 @@ describe("Public APIs:: token to string", () => {
assertDefinedTokenToString(ts.SyntaxKind.FirstKeyword, ts.SyntaxKind.LastKeyword);
});
});
describe("Public APIs:: createPrivateIdentifier", () => {
it("throws when name doesn't start with #", () => {
assert.throw(() => ts.createPrivateIdentifier("not"), "Debug Failure. First character of private identifier must be #: not");
});
});