-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mmews
committed
Feb 13, 2024
1 parent
0e4609b
commit d8b1cba
Showing
5 changed files
with
97 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
72 changes: 72 additions & 0 deletions
72
tests/org.eclipse.n4js.spec.tests/xt-tests/react_transpile/jsx_transpile_children.n4jsx.xt
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,72 @@ | ||
/* | ||
* Copyright (c) 2016 NumberFour AG. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* NumberFour AG - Initial API and implementation | ||
*/ | ||
|
||
/* XPECT_SETUP org.eclipse.n4js.spec.tests.SpecXtTest | ||
Workspace { | ||
Project "N4JSXSpecTest" { | ||
Folder "src" { | ||
ThisFile {} | ||
} | ||
File "package.json" { from="../../package_default.json" } | ||
} | ||
Project "react" { | ||
File "index.n4jsd" { from = "../react/index.n4jsd" } | ||
File "index.js" { from = "../react/index.js" } | ||
File "jsx-runtime.js" { from = "../react/jsx-runtime.js" } | ||
File "package.json" { from = "../react/package.json" } | ||
} | ||
} | ||
END_SETUP | ||
*/ | ||
|
||
|
||
// XPECT noerrors --> | ||
// XPECT nowarnings --> | ||
const MyDiv1 = <div children={"Hello World"}></div>; | ||
MyDiv1; | ||
|
||
// XPECT warnings --> "Attribute 'children' will be overwritten by jsx child elements." at "children" | ||
const MyDiv2 = <div children={"Hello World"}>{"Guten Tag"}</div>; | ||
MyDiv2; | ||
|
||
// XPECT warnings --> "Attribute 'children' will be overwritten by jsx child elements." at "children" | ||
const MyDiv3 = <div children={"Hello World"}><h2></h2></div>; | ||
MyDiv3; | ||
|
||
|
||
|
||
|
||
/* XPECT compileResult --- | ||
// Generated by N4JS transpiler; for copyright see original N4JS source file. | ||
import 'n4js-runtime' | ||
import {jsx as $jsx} from 'react/jsx-runtime.js' | ||
const MyDiv1 = $jsx('div', { | ||
children: "Hello World" | ||
}); | ||
MyDiv1; | ||
const MyDiv2 = $jsx('div', Object.assign({ | ||
children: "Hello World" | ||
}, { | ||
children: "Guten Tag" | ||
})); | ||
MyDiv2; | ||
const MyDiv3 = $jsx('div', Object.assign({ | ||
children: "Hello World" | ||
}, { | ||
children: $jsx('h2', {}) | ||
})); | ||
MyDiv3; | ||
//# sourceMappingURL=jsx_transpile_children.map | ||
--- */ |