file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates16_ES5.1.normal.js | JavaScript | //// [unicodeExtendedEscapesInTemplates16_ES5.ts]
var x = "ꯍ㑖碐";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates16_ES5.2.minified.js | JavaScript | //// [unicodeExtendedEscapesInTemplates16_ES5.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates16_ES6.1.normal.js | JavaScript | //// [unicodeExtendedEscapesInTemplates16_ES6.ts]
var x = `\u{ABCD}\u{EF12}\u{3456}\u{7890}`;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates16_ES6.2.minified.js | JavaScript | //// [unicodeExtendedEscapesInTemplates16_ES6.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates18_ES5.1.normal.js | JavaScript | //// [unicodeExtendedEscapesInTemplates18_ES5.ts]
var x = "ee";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates18_ES5.2.minified.js | JavaScript | //// [unicodeExtendedEscapesInTemplates18_ES5.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates18_ES6.1.normal.js | JavaScript | //// [unicodeExtendedEscapesInTemplates18_ES6.ts]
var x = `\u{65}\u{65}`;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates18_ES6.2.minified.js | JavaScript | //// [unicodeExtendedEscapesInTemplates18_ES6.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates20_ES5.1.normal.js | JavaScript | //// [unicodeExtendedEscapesInTemplates20_ES5.ts]
var x = "Hello world";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates20_ES5.2.minified.js | JavaScript | //// [unicodeExtendedEscapesInTemplates20_ES5.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates20_ES6.1.normal.js | JavaScript | //// [unicodeExtendedEscapesInTemplates20_ES6.ts]
var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates20_ES6.2.minified.js | JavaScript | //// [unicodeExtendedEscapesInTemplates20_ES6.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionAndIntersectionInference1.1.normal.js | JavaScript | //// [unionAndIntersectionInference1.ts]
// Repro from #2264
var y = undefined;
function destructure(something, haveValue, haveY) {
return something === y ? haveY(y) : haveValue(something);
}
var value = Math.random() > 0.5 ? 'hey!' : undefined;
var result = destructure(value, (text)=>'string', (y)=>'other one'); /... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionAndIntersectionInference1.2.minified.js | JavaScript | //// [unionAndIntersectionInference1.ts]
null.toUpperCase(), pigify(mbp).oinks, pigify(mbp).walks, f1('a'), f2('a', 'b'), Object.assign(()=>{}, {
func: ()=>{}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionAndIntersectionInference2.1.normal.js | JavaScript | //// [unionAndIntersectionInference2.ts]
var a1;
var b1;
var c1;
var d1;
var e1;
f1(a1); // string
f1(b1); // string[]
f1(c1); // string[]
f1(d1); // { name: string }
f1(e1); // number | boolean
var a2;
var b2;
var c2;
var d2;
f2(a2); // string
f2(b2); // string[]
f2(c2); // never
f2(d2); // never
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionAndIntersectionInference2.2.minified.js | JavaScript | //// [unionAndIntersectionInference2.ts]
var b1, c1, d1, e1, a2, b2, c2, d2;
f1(void 0), f1(b1), f1(c1), f1(d1), f1(e1), f2(a2), f2(b2), f2(c2), f2(d2);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionAndIntersectionInference3.1.normal.js | JavaScript | //// [unionAndIntersectionInference3.ts]
// Repro from #30720
concatMaybe([
1,
2,
3
], 4);
// Repros from #32247
const g = async (com)=>{
throw com;
};
f1 = f2;
f2 = f1;
g1 = g2;
g2 = g1;
let x1 = foo1(sa); // string
let y1 = foo1(sx); // string
let x2 = foo2(sa); // unknown
let y2 = foo2(sx); // { extr... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionAndIntersectionInference3.2.minified.js | JavaScript | //// [unionAndIntersectionInference3.ts]
concatMaybe([
1,
2,
3
], 4), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab), a = b;
export { };
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype.1.normal.js | JavaScript | //// [unionSubtypeIfEveryConstituentTypeIsSubtype.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var e = /*#__PURE__*/ function(e) {
e[e["e1"] = 0] = "e1";
e[e["e2"] = 1] = "e2";
return e;
}(e || {});
var A = function A() {
"use strict";
_class_call_check(this, A);
};... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionSubtypeIfEveryConstituentTypeIsSubtype.2.minified.js | JavaScript | //// [unionSubtypeIfEveryConstituentTypeIsSubtype.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var e, E2, e1 = ((e = e1 || {})[e.e1 = 0] = "e1", e[e.e2 = 1] = "e2", e), E21 = ((E2 = E21 || {})[E2.A = 0] = "A", E2);
function f() {}
(f || (f = {})).bar = 1;
var c = function c() {
_cl... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionThisTypeInFunctions.1.normal.js | JavaScript | //// [unionThisTypeInFunctions.ts]
function test(r) {
r.method(12); // error
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionThisTypeInFunctions.2.minified.js | JavaScript | //// [unionThisTypeInFunctions.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures.1.normal.js | JavaScript | //// [unionTypeCallSignatures.ts]
var numOrDate;
var strOrBoolean;
var strOrNum;
// If each type in U has call signatures and the sets of call signatures are identical ignoring return types,
// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signa... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures.2.minified.js | JavaScript | //// [unionTypeCallSignatures.ts]
var unionOfDifferentReturnType, unionOfDifferentReturnType1, unionOfDifferentParameterTypes, unionOfDifferentNumberOfSignatures, unionWithDifferentParameterCount, unionWithOptionalParameter1, unionWithOptionalParameter2, unionWithOptionalParameter3, unionWithRestParameter1, unionWithRe... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures2.1.normal.js | JavaScript | //// [unionTypeCallSignatures2.ts]
var f1;
var n1 = f1(42); // number
var s1 = f1("abc"); // boolean | string | number
var a1 = f1([
true,
false
]); // boolean[]
var f2;
var n2 = f2(42); // number
var s2 = f2("abc"); // number | string | boolean
var a2 = f2([
true,
false
]); // boolean[]
var f3;
var n3 ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures2.2.minified.js | JavaScript | //// [unionTypeCallSignatures2.ts]
var f1, f2, f3;
f1(42), f1("abc"), f1([
!0,
!1
]), f2(42), f2("abc"), f2([
!0,
!1
]), f3(42), f3("abc"), f3([
!0,
!1
]);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures3.1.normal.js | JavaScript | //// [unionTypeCallSignatures3.ts]
function f1(s) {}
function f2(s) {}
function f3() {
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++){
s[_key] = arguments[_key];
}
}
function f4(s, s2) {}
function f5(s, n) {}
function f6(s) {
for(var _len = arguments.length, n =... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures3.2.minified.js | JavaScript | //// [unionTypeCallSignatures3.ts]
(void 0)("");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures4.1.normal.js | JavaScript | //// [unionTypeCallSignatures4.ts]
var f12;
f12("a");
f12("a", "b");
f12("a", "b", "c"); // ok
var f34;
f34("a");
f34("a", "b");
f34("a", "b", "c");
var f1234;
f1234("a");
f1234("a", "b");
f1234("a", "b", "c"); // ok
var f12345;
f12345("a"); // error
f12345("a", "b");
f12345("a", "b", "c"); // error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures4.2.minified.js | JavaScript | //// [unionTypeCallSignatures4.ts]
var f12, f34, f1234, f12345;
f12("a"), f12("a", "b"), f12("a", "b", "c"), f34("a"), f34("a", "b"), f34("a", "b", "c"), f1234("a"), f1234("a", "b"), f1234("a", "b", "c"), f12345("a"), f12345("a", "b"), f12345("a", "b", "c");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures5.1.normal.js | JavaScript | //// [unionTypeCallSignatures5.ts]
// #31485
fn(0);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures5.2.minified.js | JavaScript | //// [unionTypeCallSignatures5.ts]
fn(0);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures6.1.normal.js | JavaScript | //// [unionTypeCallSignatures6.ts]
f1(); // error
f2(); // error
x1.f0();
x1.f1();
x1.f2();
x1.f3(); // error
x1.f4(); // error
x2.f4();
f3(); // error
f4(); // error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures6.2.minified.js | JavaScript | //// [unionTypeCallSignatures6.ts]
f1(), f2(), x1.f0(), x1.f1(), x1.f2(), x1.f3(), x1.f4(), x2.f4(), f3(), f4();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures7.1.normal.js | JavaScript | //// [unionTypeCallSignatures7.ts]
// https://github.com/microsoft/TypeScript/issues/55203
var result = f(123);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeCallSignatures7.2.minified.js | JavaScript | //// [unionTypeCallSignatures7.ts]
f(123);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeConstructSignatures.1.normal.js | JavaScript | //// [unionTypeConstructSignatures.ts]
var numOrDate;
var strOrBoolean;
var strOrNum;
// If each type in U has construct signatures and the sets of construct signatures are identical ignoring return types,
// U has the same set of construct signatures, but with return types that are unions of the return types of the re... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeConstructSignatures.2.minified.js | JavaScript | //// [unionTypeConstructSignatures.ts]
var unionOfDifferentReturnType, unionOfDifferentReturnType1, unionOfDifferentParameterTypes, unionOfDifferentNumberOfSignatures, unionWithDifferentParameterCount, unionWithOptionalParameter1, unionWithOptionalParameter2, unionWithOptionalParameter3, unionWithRestParameter1, unionW... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeEquivalence.1.normal.js | JavaScript | //// [unionTypeEquivalence.ts]
// A | B is equivalent to A if B is a subtype of A
import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
var C = function C() {
"use strict";
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeEquivalence.2.minified.js | JavaScript | //// [unionTypeEquivalence.ts]
import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.1.normal.js | JavaScript | //// [unionTypeFromArrayLiteral.ts]
// The resulting type an array literal expression is determined as follows:
// If the array literal is empty, the resulting type is an array type with the element type Undefined.
// Otherwise, if the array literal is contextually typed by a type that has a property with the numeric n... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.2.minified.js | JavaScript | //// [unionTypeFromArrayLiteral.ts]
import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeIdentity.1.normal.js | JavaScript | //// [unionTypeIdentity.ts]
// Two types are considered identical when
// they are union types with identical sets of constituent types, or
var strOrNum;
var strOrNum;
var strOrNum;
var strOrNum; // error
var strOrNum; // error
var strOrNum; // error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeIdentity.2.minified.js | JavaScript | //// [unionTypeIdentity.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeIndexSignature.1.normal.js | JavaScript | //// [unionTypeIndexSignature.ts]
var numOrDate;
var anyVar;
// If each type in U has a string index signature,
// U has a string index signature of a union type of the types of the string index signatures from each type in U.
var unionOfDifferentReturnType;
numOrDate = unionOfDifferentReturnType["hello"]; // number |... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeIndexSignature.2.minified.js | JavaScript | //// [unionTypeIndexSignature.ts]
var unionOfDifferentReturnType, unionOfTypesWithAndWithoutStringSignature, unionOfDifferentReturnType1, unionOfTypesWithAndWithoutStringSignature1;
unionOfDifferentReturnType.hello, unionOfDifferentReturnType[10], unionOfTypesWithAndWithoutStringSignature.hello, unionOfTypesWithAndWith... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeInference.1.normal.js | JavaScript | //// [unionTypeInference.ts]
const a1 = f1(1, 2); // 1 | 2
const a2 = f1(1, "hello"); // 1
const a3 = f1(1, sn); // number
const a4 = f1(undefined, "abc"); // undefined
const a5 = f1("foo", "bar"); // "foo"
const a6 = f1(true, false); // boolean
const a7 = f1("hello", 1); // Error
var b1 = f2([
"string",
true
]... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeInference.2.minified.js | JavaScript | //// [unionTypeInference.ts]
f1(1, 2), f1(1, "hello"), f1(1, sn), f1(void 0, "abc"), f1("foo", "bar"), f1(!0, !1), f1("hello", 1), f2([
"string",
!0
]), f3(5), f3(sn), f3(!0), f3(b), f3("abc"), f4("abc"), f4(s), f4(42), foo(x), bar(1, 2), Symbol(), baz(xx);
export { };
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeLiterals.1.normal.js | JavaScript | //// [unionTypeLiterals.ts]
// basic valid forms of union literals
var simpleUnion;
var unionOfUnion;
var arrayOfUnions;
var arrayOfUnions;
var unionOfFunctionType;
var unionOfFunctionType;
var unionOfFunctionType;
var unionOfConstructorType;
var unionOfConstructorType;
var unionOfConstructorType;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeLiterals.2.minified.js | JavaScript | //// [unionTypeLiterals.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeMembers.1.normal.js | JavaScript | //// [unionTypeMembers.ts]
// a union type U has those members that are present in every one of its constituent types,
// with types that are unions of the respective members in the constituent types
var x;
var str;
var num;
var strOrNum;
// If each type in U has a property P, U has a property P of a union type of the... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeMembers.2.minified.js | JavaScript | //// [unionTypeMembers.ts]
var x, str, num, strOrNum;
str = x.commonPropertyType, str = x.commonMethodType(str), strOrNum = x.commonPropertyDifferenType, strOrNum = x.commonMethodDifferentReturnType(str), x.commonMethodDifferentParameterType, x.commonMethodDifferentParameterType(strOrNum), num = x.commonMethodWithTypeP... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypePropertyAccessibility.1.normal.js | JavaScript | //// [unionTypePropertyAccessibility.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var Default = function Default() {
"use strict";
_class_call_check(this, Default);
};
var Public = function Public() {
"use strict";
_class_call_check(this, Public);
};
var Protected = fun... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypePropertyAccessibility.2.minified.js | JavaScript | //// [unionTypePropertyAccessibility.ts]
var v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15;
import "@swc/helpers/_/_class_call_check";
v1.member, v2.member, v3.member, v4.member, v5.member, v6.member, v7.member, v8.member, v9.member, v10.member, v11.member, v12.member, v13.member, v14.member, v15.mem... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeReadonly.1.normal.js | JavaScript | //// [unionTypeReadonly.ts]
var base;
base.value = 12 // error, lhs can't be a readonly property
;
var identical;
identical.value = 12; // error, lhs can't be a readonly property
var mutable;
mutable.value = 12; // error, lhs can't be a readonly property
var differentType;
differentType.value = 12; // error, lhs can't ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeReadonly.2.minified.js | JavaScript | //// [unionTypeReadonly.ts]
var identical, mutable, differentType, differentName;
(void 0).value = 12, identical.value = 12, mutable.value = 12, differentType.value = 12, differentName.value = 12;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeReduction.1.normal.js | JavaScript | //// [unionTypeReduction.ts]
var i2, i3;
var e1;
var e2 = i2 || i3; // Type of e2 immediately reduced to I3
var r1 = e1(); // Type of e1 reduced to I3 upon accessing property or signature
var r2 = e2();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeReduction.2.minified.js | JavaScript | //// [unionTypeReduction.ts]
var i2, i3;
(void 0)(), (i2 || i3)();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeReduction2.1.normal.js | JavaScript | //// [unionTypeReduction2.ts]
function f1(x, y) {
var z = !!true ? x : y; // { f(x?: string): void }
z.f();
z.f('hello');
}
function f2(x, y) {
var z = !!true ? x : y; // { f(x?: string): void }
z.f();
z.f('hello');
}
function f3(x, y) {
var f = !!true ? x : y; // (x?: string) => void
f(... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeReduction2.2.minified.js | JavaScript | //// [unionTypeReduction2.ts]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeWithIndexSignature.1.normal.js | JavaScript | //// [unionTypeWithIndexSignature.ts]
u.foo = 'bye';
u.baz = 'hi';
v.foo = false;
m.foo = 'hi';
m.bar;
ro.foo = 'not allowed';
num[0] = 1;
num['0'] = 'ok';
const sym = Symbol();
both['s'] = 'ok';
both[0] = 1;
both[1] = 0 // not ok
;
both[0] = 'not ok';
both[sym] = 'not ok';
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypeWithIndexSignature.2.minified.js | JavaScript | //// [unionTypeWithIndexSignature.ts]
u.foo = 'bye', u.baz = 'hi', v.foo = !1, m.foo = 'hi', m.bar, ro.foo = 'not allowed', num[0] = 1, num['0'] = 'ok';
const sym = Symbol();
both.s = 'ok', both[0] = 1, both[1] = 0, both[0] = 'not ok', both[sym] = 'not ok';
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypesAssignability.1.normal.js | JavaScript | //// [unionTypesAssignability.ts]
import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
var unionNumberString;
var C = function C() {
"use strict";
_class_call_check(thi... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionTypesAssignability.2.minified.js | JavaScript | //// [unionTypesAssignability.ts]
var unionNumberString, unionDE, num, str, c, d, e;
import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
c = d, c = e, c = unionDE, d = e, e = ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionsOfTupleTypes1.1.normal.js | JavaScript | //// [unionsOfTupleTypes1.ts]
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
function f1(t1, t2, t3, t4, x) {
var _t1 = _sliced_to_array(t1, 3), d10 = _t1[0], d11 = _t1[1], d12 = _t1[2]; // string, number
var _t2 = _sliced_to_array(t2, 3), d20 = _t2[0], d21 = _t2[1], d22 = _t2[2]; // s... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unionsOfTupleTypes1.2.minified.js | JavaScript | //// [unionsOfTupleTypes1.ts]
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
var _ex = _sliced_to_array([
"hi"
], 2);
_ex[0], _ex[1];
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbols.1.normal.js | JavaScript | //// [uniqueSymbols.ts]
// declarations with call initializer
const constCall = Symbol();
let letCall = Symbol();
var varCall = Symbol();
// declaration with type and call initializer
const constTypeAndCall = Symbol();
// declaration from initializer
const constInitToConstCall = constCall;
const constInitToLetCall = le... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbols.2.minified.js | JavaScript | //// [uniqueSymbols.ts]
const constCall = Symbol();
Symbol(), Symbol(), Symbol(), constType, constType, constType, constType;
class C {
static{
this.readonlyStaticCall = Symbol();
}
static{
this.readonlyStaticTypeAndCall = Symbol();
}
static{
this.readwriteStaticCall = Symbol... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarations.1.normal.js | JavaScript | //// [uniqueSymbolsDeclarations.ts]
// declarations with call initializer
const constCall = Symbol();
let letCall = Symbol();
var varCall = Symbol();
// declaration with type and call initializer
const constTypeAndCall = Symbol();
// declaration from initializer
const constInitToConstCall = constCall;
const constInitTo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarations.2.minified.js | JavaScript | //// [uniqueSymbolsDeclarations.ts]
const constCall = Symbol();
Symbol(), Symbol(), Symbol(), constType, constType, constType, constType;
class C {
static{
this.readonlyStaticCall = Symbol();
}
static{
this.readonlyStaticTypeAndCall = Symbol();
}
static{
this.readwriteStaticC... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors.1.normal.js | JavaScript | //// [uniqueSymbolsDeclarationsErrors.ts]
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ClassWithPrivateNamed... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsErrors.2.minified.js | JavaScript | //// [uniqueSymbolsDeclarationsErrors.ts]
Object.defineProperty(exports, "__esModule", {
value: !0
}), function(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: !0,
get: all[name]
});
}(exports, {
ClassWithPrivateNamedAccessors: function() {
re... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsInJs.1.normal.js | JavaScript | //// [uniqueSymbolsDeclarationsInJs.js]
// classes
class C {
static{
/**
* @readonly
*/ this.readonlyStaticCall = Symbol();
}
static{
/**
* @type {unique symbol}
* @readonly
*/ this.readonlyStaticTypeAndCall = Symbol();
}
static{
this.readwriteStaticC... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsInJs.2.minified.js | JavaScript | //// [uniqueSymbolsDeclarationsInJs.js]
class C {
static{
this.readonlyStaticCall = Symbol();
}
static{
this.readonlyStaticTypeAndCall = Symbol();
}
static{
this.readwriteStaticCall = Symbol();
}
constructor(){
this.readonlyCall = Symbol(), this.readwriteCall ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsInJsErrors.1.normal.js | JavaScript | //// [uniqueSymbolsDeclarationsInJsErrors.js]
class C {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/uniqueSymbolsDeclarationsInJsErrors.2.minified.js | JavaScript | //// [uniqueSymbolsDeclarationsInJsErrors.js]
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js | JavaScript | //// [unknownControlFlow.ts]
import { _ as _type_of } from "@swc/helpers/_/_type_of";
function f01(u) {
var x1 = u; // Error
var x2 = u;
var x3 = u;
var x4 = u;
}
function f10(x) {
if (x) {
x; // {}
} else {
x; // unknown
}
if (!x) {
x; // unknown
} else {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unknownControlFlow.2.minified.js | JavaScript | //// [unknownControlFlow.ts]
import "@swc/helpers/_/_type_of";
null.foo, null.foo, null.foo, null.foo;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unknownType1.1.normal.js | JavaScript | //// [unknownType1.ts]
// In an intersection everything absorbs unknown
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _extends } from "@swc/helpers/_/_extends";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
import { _ as _object_destructuring_empty } from "@sw... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unknownType1.2.minified.js | JavaScript | //// [unknownType1.ts]
import "@swc/helpers/_/_class_call_check";
import "@swc/helpers/_/_extends";
import "@swc/helpers/_/_instanceof";
import "@swc/helpers/_/_object_destructuring_empty";
import "@swc/helpers/_/_object_spread";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unknownType2.1.normal.js | JavaScript | //// [unknownType2.ts]
var validate = function(x) {
return x === 'yes' || x === 'no' ? x : 'idk';
}; // No error
var u = undefined;
if (u === 5) {
var y = u.toString(10);
}
if (u === true || u === false) {
var someBool = u;
}
if (u === undefined) {
var undef = u;
}
if (u === null) {
var someNull = u... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/unknownType2.2.minified.js | JavaScript | //// [unknownType2.ts]
var NumberEnum, StringEnum, u = void 0;
5 === u && u.toString(10), symb, aString, aBoolean, aNumber, anObject, anObjectLiteral, aUnion, anIntersection, aFunction;
var NumberEnum1 = ((NumberEnum = NumberEnum1 || {})[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/untypedModuleImport_allowJs.1.normal.js | JavaScript | //// [untypedModuleImport_allowJs.ts]
// Same as untypedModuleImport.ts but with --allowJs, so the package will actually be typed.
//// [/node_modules/foo/index.js]
exports.default = {
bar: function bar() {
return 0;
}
};
//// [/a.ts]
import foo from "foo";
foo.bar();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/untypedModuleImport_allowJs.2.minified.js | JavaScript | //// [untypedModuleImport_allowJs.ts]
//// [/node_modules/foo/index.js]
exports.default = {
bar: function() {
return 0;
}
};
//// [/a.ts]
import foo from "foo";
foo.bar();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries1.1.normal.js | JavaScript | //// [useObjectValuesAndEntries1.ts]
var o = {
a: 1,
b: 2
};
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = Object.values(o)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompl... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries1.2.minified.js | JavaScript | //// [useObjectValuesAndEntries1.ts]
var E, o = {
a: 1,
b: 2
}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
try {
for(var _step, _iterator = Object.values(o)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries2.1.normal.js | JavaScript | //// [useObjectValuesAndEntries2.ts]
var o = {
a: 1,
b: 2
};
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = Object.values(o)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompl... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries2.2.minified.js | JavaScript | //// [useObjectValuesAndEntries2.ts]
var o = {
a: 1,
b: 2
}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
try {
for(var _step, _iterator = Object.values(o)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries3.1.normal.js | JavaScript | //// [useObjectValuesAndEntries3.ts]
var o = {
a: 1,
b: 2
};
for (var x of Object.values(o)){
let y = x;
}
var entries = Object.entries(o);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries3.2.minified.js | JavaScript | //// [useObjectValuesAndEntries3.ts]
var o = {
a: 1,
b: 2
};
for (var x of Object.values(o));
Object.entries(o);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries4.1.normal.js | JavaScript | //// [useObjectValuesAndEntries4.ts]
var o = {
a: 1,
b: 2
};
for (var x of Object.values(o)){
let y = x;
}
var entries = Object.entries(o);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useObjectValuesAndEntries4.2.minified.js | JavaScript | //// [useObjectValuesAndEntries4.ts]
var o = {
a: 1,
b: 2
};
for (var x of Object.values(o));
Object.entries(o);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/usePromiseFinally.1.normal.js | JavaScript | //// [usePromiseFinally.ts]
var promise1 = new Promise(function(resolve, reject) {}).finally(function() {});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/usePromiseFinally.2.minified.js | JavaScript | //// [usePromiseFinally.ts]
new Promise(function(resolve, reject) {}).finally(function() {});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useRegexpGroups.1.normal.js | JavaScript | //// [useRegexpGroups.ts]
var re = RegExp("(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})", "u");
var result = re.exec("2015-01-02");
var date = result[0];
var year1 = result.groups.year;
var year2 = result[1];
var month1 = result.groups.month;
var month2 = result[2];
var day1 = result.groups.day;
var day2 = result[3]... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useRegexpGroups.2.minified.js | JavaScript | //// [useRegexpGroups.ts]
var result = RegExp("(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})", "u").exec("2015-01-02");
result[0], result.groups.year, result[1], result.groups.month, result[2], result.groups.day, result[3], "foo".match(RegExp("(?<bar>foo)")).groups.foo;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useSharedArrayBuffer1.1.normal.js | JavaScript | //// [useSharedArrayBuffer1.ts]
var foge = new SharedArrayBuffer(1024);
var bar = foge.slice(1, 10);
var len = foge.byteLength;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useSharedArrayBuffer1.2.minified.js | JavaScript | //// [useSharedArrayBuffer1.ts]
var foge = new SharedArrayBuffer(1024);
foge.slice(1, 10), foge.byteLength;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useSharedArrayBuffer2.1.normal.js | JavaScript | //// [useSharedArrayBuffer2.ts]
var foge = new SharedArrayBuffer(1024);
var bar = foge.slice(1, 10);
var len = foge.byteLength;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc/tests/tsc-references/useSharedArrayBuffer2.2.minified.js | JavaScript | //// [useSharedArrayBuffer2.ts]
var foge = new SharedArrayBuffer(1024);
foge.slice(1, 10), foge.byteLength;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.