JSX: Functional component support innerElement
This commit is contained in:
		| @@ -3056,20 +3056,16 @@ exports.jsx = void 0; | |||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             var f = constructor; |             var f = constructor; | ||||||
|             var e = Reflect.apply(f, undefined, [config]); |             var args = config !== null && config !== void 0 ? config : {}; | ||||||
|             if (e instanceof Fragment) { |  | ||||||
|                 return children; |  | ||||||
|             } |  | ||||||
|             if (children && children.length > 0) { |             if (children && children.length > 0) { | ||||||
|                 if (children.length === 1) { |                 if (children.length === 1) { | ||||||
|                     children = children[0]; |                     children = children[0]; | ||||||
|                 } |                 } | ||||||
|                 if (Reflect.has(e, "innerElement")) { |                 args.innerElement = children; | ||||||
|                     Reflect.set(e, "innerElement", children, e); |  | ||||||
|                 } |  | ||||||
|                 else { |  | ||||||
|                     throw new Error("Do not support add child for " + e.viewType()); |  | ||||||
|             } |             } | ||||||
|  |             var e = Reflect.apply(f, undefined, [args]); | ||||||
|  |             if (e instanceof Fragment) { | ||||||
|  |                 return children; | ||||||
|             } |             } | ||||||
|             return e; |             return e; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -2325,20 +2325,16 @@ exports.jsx = void 0; | |||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             const f = constructor; |             const f = constructor; | ||||||
|             const e = Reflect.apply(f, undefined, [config]); |             const args = config !== null && config !== void 0 ? config : {}; | ||||||
|             if (e instanceof Fragment) { |  | ||||||
|                 return children; |  | ||||||
|             } |  | ||||||
|             if (children && children.length > 0) { |             if (children && children.length > 0) { | ||||||
|                 if (children.length === 1) { |                 if (children.length === 1) { | ||||||
|                     children = children[0]; |                     children = children[0]; | ||||||
|                 } |                 } | ||||||
|                 if (Reflect.has(e, "innerElement")) { |                 args.innerElement = children; | ||||||
|                     Reflect.set(e, "innerElement", children, e); |  | ||||||
|                 } |  | ||||||
|                 else { |  | ||||||
|                     throw new Error(`Do not support add child for ${e.viewType()}`); |  | ||||||
|             } |             } | ||||||
|  |             const e = Reflect.apply(f, undefined, [args]); | ||||||
|  |             if (e instanceof Fragment) { | ||||||
|  |                 return children; | ||||||
|             } |             } | ||||||
|             return e; |             return e; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -3855,20 +3855,16 @@ exports.jsx = void 0; | |||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             const f = constructor; |             const f = constructor; | ||||||
|             const e = Reflect.apply(f, undefined, [config]); |             const args = config !== null && config !== void 0 ? config : {}; | ||||||
|             if (e instanceof Fragment) { |  | ||||||
|                 return children; |  | ||||||
|             } |  | ||||||
|             if (children && children.length > 0) { |             if (children && children.length > 0) { | ||||||
|                 if (children.length === 1) { |                 if (children.length === 1) { | ||||||
|                     children = children[0]; |                     children = children[0]; | ||||||
|                 } |                 } | ||||||
|                 if (Reflect.has(e, "innerElement")) { |                 args.innerElement = children; | ||||||
|                     Reflect.set(e, "innerElement", children, e); |  | ||||||
|                 } |  | ||||||
|                 else { |  | ||||||
|                     throw new Error(`Do not support add child for ${e.viewType()}`); |  | ||||||
|             } |             } | ||||||
|  |             const e = Reflect.apply(f, undefined, [args]); | ||||||
|  |             if (e instanceof Fragment) { | ||||||
|  |                 return children; | ||||||
|             } |             } | ||||||
|             return e; |             return e; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -27,20 +27,16 @@ export var jsx; | |||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             const f = constructor; |             const f = constructor; | ||||||
|             const e = Reflect.apply(f, undefined, [config]); |             const args = config !== null && config !== void 0 ? config : {}; | ||||||
|             if (e instanceof Fragment) { |  | ||||||
|                 return children; |  | ||||||
|             } |  | ||||||
|             if (children && children.length > 0) { |             if (children && children.length > 0) { | ||||||
|                 if (children.length === 1) { |                 if (children.length === 1) { | ||||||
|                     children = children[0]; |                     children = children[0]; | ||||||
|                 } |                 } | ||||||
|                 if (Reflect.has(e, "innerElement")) { |                 args.innerElement = children; | ||||||
|                     Reflect.set(e, "innerElement", children, e); |  | ||||||
|                 } |  | ||||||
|                 else { |  | ||||||
|                     throw new Error(`Do not support add child for ${e.viewType()}`); |  | ||||||
|             } |             } | ||||||
|  |             const e = Reflect.apply(f, undefined, [args]); | ||||||
|  |             if (e instanceof Fragment) { | ||||||
|  |                 return children; | ||||||
|             } |             } | ||||||
|             return e; |             return e; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -32,21 +32,16 @@ export namespace jsx { | |||||||
|             return e; |             return e; | ||||||
|         } else { |         } else { | ||||||
|             const f = constructor as Function |             const f = constructor as Function | ||||||
|             const e = Reflect.apply(f, undefined, [config]) |             const args = config ?? {} | ||||||
|             if (e instanceof Fragment) { |  | ||||||
|                 return children |  | ||||||
|             } |  | ||||||
|             if (children && children.length > 0) { |             if (children && children.length > 0) { | ||||||
|                 if (children.length === 1) { |                 if (children.length === 1) { | ||||||
|                     children = children[0] |                     children = children[0] | ||||||
|                 } |                 } | ||||||
|                 if (Reflect.has(e, "innerElement")) { |                 (args as any).innerElement = children | ||||||
|                     Reflect.set(e, "innerElement", children, e) |  | ||||||
|                 } else { |  | ||||||
|                     throw new Error( |  | ||||||
|                         `Do not support add child for ${e.viewType()}` |  | ||||||
|                     ); |  | ||||||
|             } |             } | ||||||
|  |             const e = Reflect.apply(f, undefined, [args]) | ||||||
|  |             if (e instanceof Fragment) { | ||||||
|  |                 return children | ||||||
|             } |             } | ||||||
|             return e |             return e | ||||||
|         } |         } | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								doric-web/dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								doric-web/dist/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -3929,20 +3929,16 @@ exports.jsx = void 0; | |||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             const f = constructor; |             const f = constructor; | ||||||
|             const e = Reflect.apply(f, undefined, [config]); |             const args = config !== null && config !== void 0 ? config : {}; | ||||||
|             if (e instanceof Fragment) { |  | ||||||
|                 return children; |  | ||||||
|             } |  | ||||||
|             if (children && children.length > 0) { |             if (children && children.length > 0) { | ||||||
|                 if (children.length === 1) { |                 if (children.length === 1) { | ||||||
|                     children = children[0]; |                     children = children[0]; | ||||||
|                 } |                 } | ||||||
|                 if (Reflect.has(e, "innerElement")) { |                 args.innerElement = children; | ||||||
|                     Reflect.set(e, "innerElement", children, e); |  | ||||||
|                 } |  | ||||||
|                 else { |  | ||||||
|                     throw new Error(`Do not support add child for ${e.viewType()}`); |  | ||||||
|             } |             } | ||||||
|  |             const e = Reflect.apply(f, undefined, [args]); | ||||||
|  |             if (e instanceof Fragment) { | ||||||
|  |                 return children; | ||||||
|             } |             } | ||||||
|             return e; |             return e; | ||||||
|         } |         } | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								doric-web/dist/index.js.map
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								doric-web/dist/index.js.map
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user