diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclare.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclare.ts new file mode 100644 index 00000000000..e769607f54a --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclare.ts @@ -0,0 +1,6 @@ + + +function declare(x: any, ...ys: any[]) { +} + +declare `Hello ${0} world!`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclareES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclareES6.ts new file mode 100644 index 00000000000..c526d6110ba --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclareES6.ts @@ -0,0 +1,6 @@ +//@target: es6 + +function declare(x: any, ...ys: any[]) { +} + +declare `Hello ${0} world!`; \ No newline at end of file diff --git a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface01.ts b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface01.ts new file mode 100644 index 00000000000..2af52adade6 --- /dev/null +++ b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface01.ts @@ -0,0 +1,6 @@ + +var interface: number, I: string; + +interface // This should be the identifier 'interface' +I // This should be the identifier 'I' +{} // This should be a block body \ No newline at end of file diff --git a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface02.ts b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface02.ts new file mode 100644 index 00000000000..e2cfa972f0e --- /dev/null +++ b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface02.ts @@ -0,0 +1,6 @@ + +function f(interface: number, I: string) { + interface // This should be the identifier 'interface' + I // This should be the identifier 'I' + {} // This should be a block body +} \ No newline at end of file diff --git a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface03.ts b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface03.ts new file mode 100644 index 00000000000..5b93084b0d4 --- /dev/null +++ b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface03.ts @@ -0,0 +1,8 @@ + +var interface: number, I: string; + +namespace n { + interface // This should be the identifier 'interface' + I // This should be the identifier 'I' + {} // This should be a block body +} \ No newline at end of file diff --git a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface04.ts b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface04.ts new file mode 100644 index 00000000000..3cafc549dfa --- /dev/null +++ b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface04.ts @@ -0,0 +1,7 @@ + +var declare: boolean, interface: number, I: string; + +declare // This should be the identifier 'declare' +interface // This should be the identifier 'interface' +I // This should be the identifier 'I' +{} // This should be a block body \ No newline at end of file diff --git a/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts new file mode 100644 index 00000000000..1c7dd46de6f --- /dev/null +++ b/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts @@ -0,0 +1,12 @@ +"use strict" + +var interface: number; + +// 'interface' is a strict mode reserved word, and so it would be permissible +// to allow 'interface' and the name of the interface to be on separate lines; +// however, this complicates things, and so it is preferable to restrict interface +// declarations such that their identifier must follow 'interface' on the same line. + +interface // This should be the identifier 'interface' +I // This should be the identifier 'I' +{ } // This should be a block body \ No newline at end of file