-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jsxFrag elision test (TODO: figure out with weswigham)
- Loading branch information
Showing
5 changed files
with
283 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
tests/cases/conformance/jsx/inline/jsx-globals.d.ts(1,9): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. | ||
|
||
|
||
==== tests/cases/conformance/jsx/inline/jsx-globals.d.ts (1 errors) ==== | ||
declare global { | ||
~~~~~~ | ||
!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
} | ||
} | ||
} | ||
|
||
==== tests/cases/conformance/jsx/inline/react.d.ts (0 errors) ==== | ||
export function createElement(): void; | ||
export function Fragment(): void; | ||
|
||
==== tests/cases/conformance/jsx/inline/preact.d.ts (0 errors) ==== | ||
export function h(): void; | ||
|
||
==== tests/cases/conformance/jsx/inline/snabbdom.d.ts (0 errors) ==== | ||
export function h(): void; | ||
export function Frag(): void; | ||
|
||
==== tests/cases/conformance/jsx/inline/reacty.tsx (0 errors) ==== | ||
import {createElement, Fragment} from "./react"; | ||
<><span></span></> | ||
|
||
==== tests/cases/conformance/jsx/inline/snabbdomy.tsx (0 errors) ==== | ||
/** | ||
* @jsx h | ||
* @jsxFrag Frag | ||
*/ | ||
import {h, Frag} from "./snabbdom"; | ||
<><div></div></> | ||
|
||
==== tests/cases/conformance/jsx/inline/mix-n-match.tsx (0 errors) ==== | ||
/* @jsx h */ | ||
/* @jsxFrag Frag */ | ||
import {h} from "./preact"; | ||
import {Frag} from "./snabbdom"; | ||
<><span></span></> |
65 changes: 65 additions & 0 deletions
65
tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//// [tests/cases/conformance/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.tsx] //// | ||
|
||
//// [jsx-globals.d.ts] | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
} | ||
} | ||
} | ||
|
||
//// [react.d.ts] | ||
export function createElement(): void; | ||
export function Fragment(): void; | ||
|
||
//// [preact.d.ts] | ||
export function h(): void; | ||
|
||
//// [snabbdom.d.ts] | ||
export function h(): void; | ||
export function Frag(): void; | ||
|
||
//// [reacty.tsx] | ||
import {createElement, Fragment} from "./react"; | ||
<><span></span></> | ||
|
||
//// [snabbdomy.tsx] | ||
/** | ||
* @jsx h | ||
* @jsxFrag Frag | ||
*/ | ||
import {h, Frag} from "./snabbdom"; | ||
<><div></div></> | ||
|
||
//// [mix-n-match.tsx] | ||
/* @jsx h */ | ||
/* @jsxFrag Frag */ | ||
import {h} from "./preact"; | ||
import {Frag} from "./snabbdom"; | ||
<><span></span></> | ||
|
||
//// [reacty.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var react_1 = require("./react"); | ||
react_1.createElement(react_1.Fragment, null, | ||
react_1.createElement("span", null)); | ||
//// [snabbdomy.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
/** | ||
* @jsx h | ||
* @jsxFrag Frag | ||
*/ | ||
var snabbdom_1 = require("./snabbdom"); | ||
snabbdom_1.h(snabbdom_1.Frag, null, | ||
snabbdom_1.h("div", null)); | ||
//// [mix-n-match.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
/* @jsx h */ | ||
/* @jsxFrag Frag */ | ||
var preact_1 = require("./preact"); | ||
preact_1.h(snabbdom_1.Frag, null, | ||
preact_1.h("span", null)); |
62 changes: 62 additions & 0 deletions
62
tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
=== tests/cases/conformance/jsx/inline/jsx-globals.d.ts === | ||
declare global { | ||
>global : Symbol(global, Decl(jsx-globals.d.ts, 0, 0)) | ||
|
||
namespace JSX { | ||
>JSX : Symbol(JSX, Decl(jsx-globals.d.ts, 0, 16)) | ||
|
||
interface IntrinsicElements { | ||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(jsx-globals.d.ts, 1, 19)) | ||
|
||
[e: string]: any; | ||
>e : Symbol(e, Decl(jsx-globals.d.ts, 3, 13)) | ||
} | ||
} | ||
} | ||
|
||
=== tests/cases/conformance/jsx/inline/react.d.ts === | ||
export function createElement(): void; | ||
>createElement : Symbol(createElement, Decl(react.d.ts, 0, 0)) | ||
|
||
export function Fragment(): void; | ||
>Fragment : Symbol(Fragment, Decl(react.d.ts, 0, 38)) | ||
|
||
=== tests/cases/conformance/jsx/inline/preact.d.ts === | ||
export function h(): void; | ||
>h : Symbol(h, Decl(preact.d.ts, 0, 0)) | ||
|
||
=== tests/cases/conformance/jsx/inline/snabbdom.d.ts === | ||
export function h(): void; | ||
>h : Symbol(h, Decl(snabbdom.d.ts, 0, 0)) | ||
|
||
export function Frag(): void; | ||
>Frag : Symbol(Frag, Decl(snabbdom.d.ts, 0, 26)) | ||
|
||
=== tests/cases/conformance/jsx/inline/reacty.tsx === | ||
import {createElement, Fragment} from "./react"; | ||
>createElement : Symbol(createElement, Decl(reacty.tsx, 0, 8)) | ||
>Fragment : Symbol(Fragment, Decl(reacty.tsx, 0, 22)) | ||
|
||
<><span></span></> | ||
|
||
=== tests/cases/conformance/jsx/inline/snabbdomy.tsx === | ||
/** | ||
* @jsx h | ||
* @jsxFrag Frag | ||
*/ | ||
import {h, Frag} from "./snabbdom"; | ||
>h : Symbol(h, Decl(snabbdomy.tsx, 4, 8)) | ||
>Frag : Symbol(Frag, Decl(snabbdomy.tsx, 4, 10)) | ||
|
||
<><div></div></> | ||
|
||
=== tests/cases/conformance/jsx/inline/mix-n-match.tsx === | ||
/* @jsx h */ | ||
/* @jsxFrag Frag */ | ||
import {h} from "./preact"; | ||
>h : Symbol(h, Decl(mix-n-match.tsx, 2, 8)) | ||
|
||
import {Frag} from "./snabbdom"; | ||
>Frag : Symbol(Frag, Decl(mix-n-match.tsx, 3, 8)) | ||
|
||
<><span></span></> |
71 changes: 71 additions & 0 deletions
71
tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
=== tests/cases/conformance/jsx/inline/jsx-globals.d.ts === | ||
declare global { | ||
>global : typeof global | ||
|
||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
>e : string | ||
} | ||
} | ||
} | ||
|
||
=== tests/cases/conformance/jsx/inline/react.d.ts === | ||
export function createElement(): void; | ||
>createElement : () => void | ||
|
||
export function Fragment(): void; | ||
>Fragment : () => void | ||
|
||
=== tests/cases/conformance/jsx/inline/preact.d.ts === | ||
export function h(): void; | ||
>h : () => void | ||
|
||
=== tests/cases/conformance/jsx/inline/snabbdom.d.ts === | ||
export function h(): void; | ||
>h : () => void | ||
|
||
export function Frag(): void; | ||
>Frag : () => void | ||
|
||
=== tests/cases/conformance/jsx/inline/reacty.tsx === | ||
import {createElement, Fragment} from "./react"; | ||
>createElement : () => void | ||
>Fragment : () => void | ||
|
||
<><span></span></> | ||
><><span></span></> : any | ||
><span></span> : any | ||
>span : any | ||
>span : any | ||
|
||
=== tests/cases/conformance/jsx/inline/snabbdomy.tsx === | ||
/** | ||
* @jsx h | ||
* @jsxFrag Frag | ||
*/ | ||
import {h, Frag} from "./snabbdom"; | ||
>h : () => void | ||
>Frag : () => void | ||
|
||
<><div></div></> | ||
><><div></div></> : any | ||
><div></div> : any | ||
>div : any | ||
>div : any | ||
|
||
=== tests/cases/conformance/jsx/inline/mix-n-match.tsx === | ||
/* @jsx h */ | ||
/* @jsxFrag Frag */ | ||
import {h} from "./preact"; | ||
>h : () => void | ||
|
||
import {Frag} from "./snabbdom"; | ||
>Frag : () => void | ||
|
||
<><span></span></> | ||
><><span></span></> : any | ||
><span></span> : any | ||
>span : any | ||
>span : any | ||
|
42 changes: 42 additions & 0 deletions
42
tests/cases/conformance/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// @jsx: react | ||
// @jsxFactory: createElement | ||
// @jsxFragmentFactory: Fragment | ||
|
||
// @filename: jsx-globals.d.ts | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
} | ||
} | ||
} | ||
|
||
// @filename: react.d.ts | ||
export function createElement(): void; | ||
export function Fragment(): void; | ||
|
||
// @filename: preact.d.ts | ||
export function h(): void; | ||
|
||
// @filename: snabbdom.d.ts | ||
export function h(): void; | ||
export function Frag(): void; | ||
|
||
// @filename: reacty.tsx | ||
import {createElement, Fragment} from "./react"; | ||
<><span></span></> | ||
|
||
// @filename: snabbdomy.tsx | ||
/** | ||
* @jsx h | ||
* @jsxFrag Frag | ||
*/ | ||
import {h, Frag} from "./snabbdom"; | ||
<><div></div></> | ||
|
||
// @filename: mix-n-match.tsx | ||
/* @jsx h */ | ||
/* @jsxFrag Frag */ | ||
import {h} from "./preact"; | ||
import {Frag} from "./snabbdom"; | ||
<><span></span></> |