120 lines
3.7 KiB
Plaintext
120 lines
3.7 KiB
Plaintext
=== tests/cases/compiler/Element.ts ===
|
|
|
|
declare namespace JSX {
|
|
>JSX : Symbol(JSX, Decl(Element.ts, 0, 0))
|
|
|
|
interface Element {
|
|
>Element : Symbol(Element, Decl(Element.ts, 1, 23))
|
|
|
|
name: string;
|
|
>name : Symbol(Element.name, Decl(Element.ts, 2, 23))
|
|
|
|
isIntrinsic: boolean;
|
|
>isIntrinsic : Symbol(Element.isIntrinsic, Decl(Element.ts, 3, 21))
|
|
|
|
isCustomElement: boolean;
|
|
>isCustomElement : Symbol(Element.isCustomElement, Decl(Element.ts, 4, 29))
|
|
|
|
toString(renderId?: number): string;
|
|
>toString : Symbol(Element.toString, Decl(Element.ts, 5, 33))
|
|
>renderId : Symbol(renderId, Decl(Element.ts, 6, 17))
|
|
|
|
bindDOM(renderId?: number): number;
|
|
>bindDOM : Symbol(Element.bindDOM, Decl(Element.ts, 6, 44))
|
|
>renderId : Symbol(renderId, Decl(Element.ts, 7, 16))
|
|
|
|
resetComponent(): void;
|
|
>resetComponent : Symbol(Element.resetComponent, Decl(Element.ts, 7, 43))
|
|
|
|
instantiateComponents(renderId?: number): number;
|
|
>instantiateComponents : Symbol(Element.instantiateComponents, Decl(Element.ts, 8, 31))
|
|
>renderId : Symbol(renderId, Decl(Element.ts, 9, 30))
|
|
|
|
props: any;
|
|
>props : Symbol(Element.props, Decl(Element.ts, 9, 57))
|
|
}
|
|
}
|
|
export namespace Element {
|
|
>Element : Symbol(Element, Decl(Element.ts, 12, 1))
|
|
|
|
export function isElement(el: any): el is JSX.Element {
|
|
>isElement : Symbol(isElement, Decl(Element.ts, 13, 26))
|
|
>el : Symbol(el, Decl(Element.ts, 14, 30))
|
|
>el : Symbol(el, Decl(Element.ts, 14, 30))
|
|
>JSX : Symbol(JSX, Decl(Element.ts, 0, 0))
|
|
>Element : Symbol(JSX.Element, Decl(Element.ts, 1, 23))
|
|
|
|
return el.markAsChildOfRootElement !== undefined;
|
|
>el : Symbol(el, Decl(Element.ts, 14, 30))
|
|
>undefined : Symbol(undefined)
|
|
}
|
|
|
|
export function createElement(args: any[]) {
|
|
>createElement : Symbol(createElement, Decl(Element.ts, 16, 5))
|
|
>args : Symbol(args, Decl(Element.ts, 18, 34))
|
|
|
|
return {
|
|
}
|
|
}
|
|
}
|
|
|
|
export let createElement = Element.createElement;
|
|
>createElement : Symbol(createElement, Decl(Element.ts, 25, 10))
|
|
>Element.createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5))
|
|
>Element : Symbol(Element, Decl(Element.ts, 12, 1))
|
|
>createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5))
|
|
|
|
function toCamelCase(text: string): string {
|
|
>toCamelCase : Symbol(toCamelCase, Decl(Element.ts, 25, 49))
|
|
>text : Symbol(text, Decl(Element.ts, 27, 21))
|
|
|
|
return text[0].toLowerCase() + text.substring(1);
|
|
>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
|
|
>text : Symbol(text, Decl(Element.ts, 27, 21))
|
|
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
|
|
>text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --))
|
|
>text : Symbol(text, Decl(Element.ts, 27, 21))
|
|
>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --))
|
|
}
|
|
|
|
=== tests/cases/compiler/test.tsx ===
|
|
import { Element} from './Element';
|
|
>Element : Symbol(Element, Decl(test.tsx, 0, 8))
|
|
|
|
let c: {
|
|
>c : Symbol(c, Decl(test.tsx, 2, 3))
|
|
|
|
a?: {
|
|
>a : Symbol(a, Decl(test.tsx, 2, 8))
|
|
|
|
b: string
|
|
>b : Symbol(b, Decl(test.tsx, 3, 6))
|
|
}
|
|
};
|
|
|
|
class A {
|
|
>A : Symbol(A, Decl(test.tsx, 6, 2))
|
|
|
|
view() {
|
|
>view : Symbol(A.view, Decl(test.tsx, 8, 9))
|
|
|
|
return [
|
|
<meta content="helloworld"></meta>,
|
|
>meta : Symbol(unknown)
|
|
>content : Symbol(content, Decl(test.tsx, 11, 8))
|
|
>meta : Symbol(unknown)
|
|
|
|
<meta content={c.a!.b}></meta>
|
|
>meta : Symbol(unknown)
|
|
>content : Symbol(content, Decl(test.tsx, 12, 8))
|
|
>c.a!.b : Symbol(b, Decl(test.tsx, 3, 6))
|
|
>c.a : Symbol(a, Decl(test.tsx, 2, 8))
|
|
>c : Symbol(c, Decl(test.tsx, 2, 3))
|
|
>a : Symbol(a, Decl(test.tsx, 2, 8))
|
|
>b : Symbol(b, Decl(test.tsx, 3, 6))
|
|
>meta : Symbol(unknown)
|
|
|
|
];
|
|
}
|
|
}
|