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_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/static_property_tdz_false_alarm.js | JavaScript | let A = function A() {
"use strict";
_class_call_check(this, A);
};
_define_property(A, "A", 123);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/static_property_tdz_general.js | JavaScript | let _ref = (_class_name_tdz_error("C"), C) + 3;
let C = function C() {
"use strict";
_class_call_check(this, C);
};
_define_property(C, _ref, 3);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/arguments-fn-expr/input.js | JavaScript | function test() {
return function () {
return arguments[0];
};
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/arguments-fn-expr/output.js | JavaScript | function test() {
return function() {
return arguments[0];
};
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/arguments-member/input.js | JavaScript | function test() {
return (foo) => {
return foo.arguments;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/arguments-member/output.js | JavaScript | function test() {
return function(foo) {
return foo.arguments;
};
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/arguments/input.js | JavaScript | function test() {
return () => arguments[0];
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/arguments/output.js | JavaScript | function test() {
var _arguments = arguments;
return function() {
return _arguments[0];
};
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/basic/input.js | JavaScript | let echo = (bar) => bar | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/basic/output.js | JavaScript | let echo = function(bar) {
return bar;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/chrome-46/input.js | JavaScript | function foo() {
const a = (a) => new.target
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/chrome-46/output.js | JavaScript | function foo() {
var _newtarget = new.target;
const a = function(a) {
return _newtarget;
};
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/computed-props/input.js | JavaScript | var a = {
[(() => this)()]: 123
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/computed-props/output.js | JavaScript | var _this = this;
var a = {
[function() {
return _this;
}()]: 123
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/destructuring/input.js | JavaScript | let foo = ({ bar }) => undefined; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/destructuring/output.js | JavaScript | let foo = function({ bar }) {
return undefined;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/empty-arguments/input.js | JavaScript | var t = () => 5 + 5; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/empty-arguments/output.js | JavaScript | var t = function() {
return 5 + 5;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/expression/input.js | JavaScript | arr.map(x => x * x); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/expression/output.js | JavaScript | arr.map(function(x) {
return x * x;
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/fixture-arguments/input.js | JavaScript | function fn() {
var foo = () => {
return arguments;
};
}
var bar = () => arguments;
var baz = () => () => arguments; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/fixture-arguments/output.js | JavaScript | var _arguments = arguments;
function fn() {
var _arguments = arguments;
var foo = function() {
return _arguments;
};
}
var bar = function() {
return _arguments;
};
var baz = function() {
return function() {
return _arguments;
};
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/fixture-this/input.js | JavaScript | function b() {
var t = x => this.x + x;
}
class Foo extends (function () { }) {
constructor() {
var foo = () => this;
if (true) {
console.log(super(), foo());
} else {
super();
console.log(foo());
}
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/fixture-this/output.js | JavaScript | function b() {
var _this = this;
var t = function(x) {
return _this.x + x;
};
}
class Foo extends function() {} {
constructor(){
var _this;
var foo = function() {
return _this;
};
if (true) {
console.log((super(), _this = this), foo());
} else {
super(), _this = this;
console.log(foo());
}
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/getter-setter/input.js | JavaScript | const a = () => ({
get this() { this; arguments },
set arguments(a = this) { this; arguments },
get [this]() { this; arguments },
}) | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/getter-setter/output.js | JavaScript | var _this = this;
const a1 = function() {
return {
get this () {
this;
arguments;
},
set arguments (a = this){
this;
arguments;
},
get [_this] () {
this;
arguments;
}
};
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/inside-call/input.js | JavaScript | arr.map(i => i + 1); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/inside-call/output.js | JavaScript | arr.map(function(i) {
return i + 1;
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-1/input.js | JavaScript | const foo = () => this | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-1/output.js | JavaScript | var _this = this;
const foo = function() {
return _this;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-2/input.js | JavaScript | const foo = function () {
() => () => () => this
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-2/output.js | JavaScript | const foo = function() {
var _this = this;
(function() {
return function() {
return function() {
return _this;
};
};
});
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-233/input.js | JavaScript | const foo = () => ({ x, ...y }) => y | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-233/output.js | JavaScript | const foo = function() {
return function({ x , ...y }) {
return y;
};
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-413/input.js | JavaScript | export const getBadgeBorderRadius = (text, color) => {
return (text && style) || {}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/issue-413/output.js | JavaScript | export const getBadgeBorderRadius = function(text, color) {
return text && style || {};
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/method-captured/input.js | JavaScript | const a = () => ({
[this](a = this) { this; arguments },
})
const b = () => class {
static [this]() { }
[arguments]() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/method-captured/output.js | JavaScript | var _this = this;
const a = function() {
return {
[_this] (a = this) {
this;
arguments;
}
};
};
const b = function() {
return class {
static [this]() {}
[arguments]() {}
};
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/multiple-arguments/input.js | JavaScript | var t = (i, x) => i * x; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/multiple-arguments/output.js | JavaScript | var t = function(i, x) {
return i * x;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/paren-insertion/input.js | JavaScript | var t = i => i * 5; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/paren-insertion/output.js | JavaScript | var t = function(i) {
return i * 5;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/single-argument/input.js | JavaScript | var t = (i) => i * 5; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/single-argument/output.js | JavaScript | var t = function(i) {
return i * 5;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/statement/input.js | JavaScript | nums.forEach(v => {
if (v % 5 === 0) {
fives.push(v);
}
}); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/statement/output.js | JavaScript | nums.forEach(function(v) {
if (v % 5 === 0) {
fives.push(v);
}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/this-in-params/input.js | JavaScript | export const getBadgeBorderRadius = (text = this, color = arguments) => {
return (text && style) || {}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/this-in-params/output.js | JavaScript | var _this = this, _arguments = arguments;
export const getBadgeBorderRadius = function(text = _this, color = _arguments) {
return text && style || {};
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/two-arrow/input.js | JavaScript | let foo = () => this;
let bar = () => this;
let foo1 = () => arguments;
let bar1 = () => arguments; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/arrow/two-arrow/output.js | JavaScript | var _this = this, _arguments = arguments;
let foo = function() {
return _this;
};
let bar = function() {
return _this;
};
let foo1 = function() {
return _arguments;
};
let bar1 = function() {
return _arguments;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-1718/exec.js | JavaScript | async function scanUser(groups) {
await Promise.all(
groups.map(async ({ users }) => {
for (const user of users) {
console.log("user", user);
await new Promise((resolve) => setTimeout(resolve, 30));
}
})
);
}
scanUser([{ users: [1, 2, 3, 4, 5] }, { users: [11, 12, 13, 14, 15] }]);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-1721/exec.js | JavaScript | async function* lol() {
yield 1;
yield 2;
}
async function main() {
for await (const x of lol()) {
console.log(x);
}
}
main();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-1892/exec.js | JavaScript | function* gen() {
var firstTime = true;
outer:
while (true) {
yield 0;
try {
while (true) {
yield 1;
if (firstTime) {
firstTime = false;
yield 2;
continue outer;
} else {
yield 3;
break;
}
}
yield 4;
break;
} finally {
yield 5;
}
yield 6;
}
yield 7;
}
const iter = gen();
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
console.log(iter.next())
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-1918/exec.js | JavaScript | (async function () {
let counter = 0;
let resolve;
let promise = new Promise((r) => (resolve = r));
let iterable = {
[Symbol.asyncIterator]() {
return {
next() {
return promise;
},
};
},
};
const res = (async () => {
for await (let value of iterable) {
counter++;
console.log(value);
}
if (counter !== 2) {
throw new Error("");
}
})();
for (let v of [0, 1]) {
await null;
let oldresolve = resolve;
promise = new Promise((r) => (resolve = r));
oldresolve({ value: v, done: false });
}
resolve({ value: undefined, done: true });
await res;
})();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-2248/exec.js | JavaScript | const foo = async () => {
try {
console.log(1);
} catch (err) {
console.log(err.message);
}
};
foo();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-2306/exec.js | JavaScript | async function* g1() {
yield "OK";
yield "OK";
yield "OK";
}
async function* g2() {
for await (const g of g1()) {
console.log("g2:", g);
yield g;
}
}
(async () => {
for await (const g of g2()) {
console.log("main:", g);
}
})();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-2556/1/exec.js | JavaScript | var fib = function fib(n) {
return 42;
};
async function init() {
return fib;
async function fib(n) {
if (n <= 1) {
return n;
}
const x = await fib(n - 1);
const y = await fib(n - 2);
return x + y;
}
}
console.log("start");
init()
.then((fib) => fib(10))
.then(console.log)
.finally(() => console.log("end"));
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-2556/2/exec.js | JavaScript | async function foo(a) {
return bar1;
async function bar1(b) {
return bar2;
async function bar2(c) {
return bar3;
async function bar3(d) {
return a + b + c + d;
}
}
}
}
foo(1)
.then((t) => t(2))
.then((t) => t(3))
.then((t) => t(4))
.then(console.log);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-2556/3/exec.js | JavaScript | var bar1 = 1,
bar2 = 2,
bar3 = 3;
async function foo(a) {
return bar1;
async function bar1(b) {
return bar2;
async function bar2(c) {
return bar3;
async function bar3(d) {
return a + b + c + d;
}
}
}
}
foo(1)
.then((t) => t(2))
.then((t) => t(3))
.then((t) => t(4))
.then(console.log);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3006/exec.js | JavaScript | async function a() {
for (const number_in_a_sequence of Array.from(new Array(7), (_, i) => i)) {
setTimeout(() => console.log(number_in_a_sequence), 10);
}
}
a();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3135/1/exec.js | JavaScript | async function foo1(one, two, three) {
return 42;
}
console.log(foo1.length);
async function* foo2(one, two, three) {
return 42;
}
console.log(foo2.length);
const bar1 = async function (one, two, three) {
return 42;
};
console.log(bar1.length);
const bar2 = async function* (one, two, three) {
return 42;
};
console.log(bar2.length);
const bar3 = async (one, two, three) => {
return 42;
};
console.log(bar3.length);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3135/2/exec.js | JavaScript | const expect = require("expect");
const foo = async (x, y, ...z) => {
return this;
};
const _this = (() => this)();
console.log(foo.length);
expect(typeof foo(1, 2, 3)).toEqual("object");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3182/1/exec.js | JavaScript | const myWrapper = (myFunc) => {
console.log("arity", myFunc.length);
};
myWrapper(async (one, two, three) => {
return "irrelevant";
});
(async () => {
(async (x, y, myWrapper, myFunc) => {
x(console.log, y);
myWrapper(myFunc);
})(
async function (...[x, y]) {
return x(y);
},
await (async function bar(x, y, ...z) {
return bar.length;
})(),
(myFunc) => {
console.log("arity", myFunc.length);
},
async (one, two, three) => {
return "irrelevant";
}
);
})();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3182/2/exec.js | JavaScript | console.log((async (x, y) => {}).length);
console.log((async (x, ...y) => {}).length);
console.log((async (x = 1, ...y) => {}).length);
console.log(async function (x, y) {}.length);
console.log(async function (x, ...y) {}.length);
console.log(async function (x = 1, ...y) {}.length);
console.log((async (x, []) => {}).length);
console.log((async (x, ...[]) => {}).length);
console.log((async (x = 1, ...[]) => {}).length);
console.log(async function (x, [a]) {}.length);
console.log(async function (x, ...[a]) {}.length);
console.log(async function (x = 1, ...[a]) {}.length);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3182/3/exec.js | JavaScript | // Z Combinator
const Z = (f) => ((x) => f((y) => x(x)(y)))((x) => f((y) => x(x)(y)));
const p = Z(
(f) =>
async (n = 0) =>
n <= 1 ? 1 : n * (await f(n - 1))
)(5);
// expect to be 120
p.then((result) => console.log(result));
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-3228/1/exec.js | JavaScript | class StaticTestClass {
static testProp = "Hello world!";
static testMethod = () => {
console.log(this.testProp);
};
}
StaticTestClass.testMethod();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-4405/exec.js | JavaScript | async function* asyncGenerator() {
for (let i = 5; i < 10; i++) {
yield new Promise((res) => setTimeout(() => res({ success: true }), 5));
}
yield { success: true };
}
async function* execute() {
yield* asyncGenerator();
}
(async () => {
for await (const p of execute()) {
console.log(await p);
}
})();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-4486/1/exec.js | JavaScript | const obj = {
a: 'a',
b: 'b',
c: 'c',
d: 'd',
}
const wait = n => new Promise(r => setTimeout(r, n))
const action = async () => {
for (let i in obj) {
// halt for a second
await wait(1000)
// this one is trouble
wait(1000).then(() => console.log(i))
}
console.log('done')
}
action() | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-5383/1/exec.js | JavaScript | const a1 = [1, 2, 3];
const a2 = a1.map((x) => Promise.resolve(x));
async function f() {
for await (const v of a2) {
console.log(v);
}
}
f(); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-5913/1/exec.js | JavaScript | function* generator() {
try {
while (true) {
yield "foo";
}
} finally {
yield "bar";
}
}
function test() {
const gen = generator();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
}
test(); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-5913/2/exec.js | JavaScript | function* generator() {
try {
while (true) {
yield "foo";
}
} finally {
}
}
function test() {
const gen = generator();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
}
test(); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-8155/exec.js | JavaScript | const someFn = (xx, x, y) => [x, y];
const getArray = () => [1, 2, 3];
const goodFunction = async () => {
const rb = await getArray();
const rc = await getArray();
console.log(someFn(1, rb, rc));
}
const badFunction = async () => {
console.log(someFn(1, await getArray(), await getArray()))
}
goodFunction();
badFunction();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-8805/1/exec.js | JavaScript | async function* foo() {
yield 1
}
async function* bar(inputs, returnValues) {
for await (const input of inputs) {
if (!returnValues) {
return
}
yield input
}
}
async function run() {
for await (const number of bar(foo(), true)) {
console.log(number)
}
}
run() | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/issue-8805/2/exec.js | JavaScript | async function* foo() {
yield 1
}
async function* bar(inputs, returnValues) {
for await (const input of inputs) {
if (!returnValues) {
return
}
yield input
}
}
async function run() {
for await (const value of bar(foo(), false)) {
console.log(value)
}
}
run() | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/nested-try/in-block-no-handler/exec.js | JavaScript | const { async } = require("regenerator-runtime");
async function f() {
try {
try {
throw "Test";
} finally {
}
} catch (e) {
console.log(e);
}
}
f();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/nested-try/in-blokc-with-handler/exec.js | JavaScript | const { async } = require("regenerator-runtime");
async function f() {
try {
try {
throw "Test";
} catch (e) {
console.log(e);
throw "catch me if you can";
} finally {
}
} catch (e) {
console.log(e);
}
}
f();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/nested-try/in-finally-with-catch/exec.js | JavaScript | const { async } = require("regenerator-runtime");
async function f() {
try {
throw new "Real error"();
} catch (e1) {
console.log(e1.message);
try {
throw "Test";
} catch (e2) {
console.log(e2);
}
}
}
f();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/nested-try/in-finally-witthout-catch/exec.js | JavaScript | const { async } = require("regenerator-runtime");
async function f() {
try {
} finally {
try {
throw "Test";
} catch (e) {
console.log(e);
}
}
}
f();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/vercel/regression-1/1/exec.js | JavaScript | class Test {
constructor(name) {
this.name = name;
}
print = async (arg) => {
console.log(this.name, arg);
};
}
function Parent() {
new Test("name").print("test");
}
Parent();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/async-to-generator/vercel/regression-1/2/exec.js | JavaScript | function Foo() {
this.isFoo = true;
const forThis = async () => {
return this.isFoo;
};
const forArguments = async () => {
return arguments[0];
};
return {
forThis,
forArguments,
};
}
const foo = new Foo(0);
console.log(foo.forThis());
console.log(foo.forArguments());
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-2627/1/input.js | JavaScript | {
let a = 1;
const b = 1;
var c = 1;
}
console.log(a);
console.log(b);
console.log(c);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-2627/1/output.js | JavaScript | {
var _$a__4 = 1;
var _$b__5 = 1;
var c__2 = 1;
}console.log(a);
console.log(b);
console.log(c__2);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-3235/1/input.js | JavaScript | let res = [];
let a = 2;
res.push(a === 2);
{
let b = 1;
}
res.push(typeof b === "undefined");
if (true) {
let b = 0;
}
res.push(typeof b === "undefined");
for (let b = 0; b < 10; b++) {}
res.push(typeof b === "undefined");
function test() {
let b = 7;
}
res.push(typeof b === "undefined");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-3235/1/output.js | JavaScript | var res__2 = [];
var a__2 = 2;
res__2.push(a__2 === 2);
{
var _$b__8 = 1;
}res__2.push(typeof b === "undefined");
if (true) {
var _$b__9 = 0;
}
res__2.push(typeof b === "undefined");
for(var _$b__10 = 0; _$b__10 < 10; _$b__10++){}
res__2.push(typeof b === "undefined");
function test__2() {
var _$b__11 = 7;
}
res__2.push(typeof b === "undefined");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-3347/exec.js | JavaScript | const myFunction = () => {
for (let j = 0; j <= 3; j++) {
for (const _ of []) {
}
if (j === 1) {
console.log("before set timeout, j is:", j);
setTimeout(() => {
console.log("in timeout: j is", j);
}, 50);
}
}
return null;
};
myFunction();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4225/1/exec.js | JavaScript | let v0 = new Array(2);
var v1 = v0 || [];
for (var v2 = 0; v2 < v1.length; v2++) {
var v2 = v1.v2;
v0.push(v2 * 2);
}
console.log(v0);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4225/2/exec.js | JavaScript | for (var a = 0; a < 10; a++) {
console.log(a);
var a = 10;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/1/input.js | JavaScript | out: for (let i = 0; i < 4; i++) {
for (let j = 0; j < 4; ++j) {
if (i < 2) continue out;
[1].forEach((_) => {
console.log(i, j);
});
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/1/output.js | JavaScript | var _loop__10 = function(i__3) {
var _loop__8 = function(j__5) {
if (i__3 < 2) return "continue|out";
[
1
].forEach((___7)=>{
console.log(i__3, j__5);
});
};
for(var j__5 = 0; j__5 < 4; ++j__5){
var _ret__9 = _loop__8(j__5);
switch(_ret__9){
case "continue|out":
return "continue|out";
}
}
};
out__0: for(var i__3 = 0; i__3 < 4; i__3++){
var _ret__11 = _loop__10(i__3);
switch(_ret__11){
case "continue|out":
continue out__0;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/2/input.js | JavaScript | for (let i = 0; i < 4; i++) {
for (let j = 0; j < 4; ++j) {
if (i < 2) continue;
[1].forEach((_) => {
console.log(i, j);
});
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/2/output.js | JavaScript | var _loop__9 = function(i__3) {
var _loop__8 = function(j__5) {
if (i__3 < 2) return "continue";
[
1
].forEach((___7)=>{
console.log(i__3, j__5);
});
};
for(var j__5 = 0; j__5 < 4; ++j__5)_loop__8(j__5);
};
for(var i__3 = 0; i__3 < 4; i__3++)_loop__9(i__3);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/3/input.js | JavaScript | out: for (let i = 0; i < 4; i++) {
for (let j = 0; j < 4; ++j) {
if (i > 2) break out;
[1].forEach((_) => {
console.log(i, j);
});
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/3/output.js | JavaScript | var _loop__10 = function(i__3) {
var _loop__8 = function(j__5) {
if (i__3 > 2) return "break|out";
[
1
].forEach((___7)=>{
console.log(i__3, j__5);
});
};
for(var j__5 = 0; j__5 < 4; ++j__5){
var _ret__9 = _loop__8(j__5);
switch(_ret__9){
case "break|out":
return "break|out";
}
}
};
out__0: for(var i__3 = 0; i__3 < 4; i__3++){
var _ret__11 = _loop__10(i__3);
switch(_ret__11){
case "break|out":
break out__0;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/4/input.js | JavaScript | for (let i = 0; i < 4; i++) {
for (let j = 0; j < 4; ++j) {
if (i > 2) break;
[1].forEach((_) => {
console.log(i, j);
});
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/4/output.js | JavaScript | var _loop__10 = function(i__3) {
var _loop__8 = function(j__5) {
if (i__3 > 2) return "break";
[
1
].forEach((___7)=>{
console.log(i__3, j__5);
});
};
for(var j__5 = 0; j__5 < 4; ++j__5){
var _ret__9 = _loop__8(j__5);
if (_ret__9 === "break") break;
}
};
for(var i__3 = 0; i__3 < 4; i__3++)_loop__10(i__3);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/5/input.js | JavaScript | for (let i = 0; i < 4; i++) {
b: for (let j = 0; j < 4; ++j) {
if (i < 2) continue b;
[1].forEach((_) => {
console.log(i, j);
});
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4238/5/output.js | JavaScript | var _loop__10 = function(i__3) {
var _loop__8 = function(j__5) {
if (i__3 < 2) return "continue|b";
[
1
].forEach((___7)=>{
console.log(i__3, j__5);
});
};
b__0: for(var j__5 = 0; j__5 < 4; ++j__5){
var _ret__9 = _loop__8(j__5);
switch(_ret__9){
case "continue|b":
continue b__0;
}
}
};
for(var i__3 = 0; i__3 < 4; i__3++)_loop__10(i__3);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4286/1/input.js | JavaScript | console.log([
...(function* () {
for (const i of [1, 2, 3]) {
Promise.resolve().then(() => {
console.log(`async: ${i}`);
});
yield i;
}
})(),
]); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4286/1/output.js | JavaScript | console.log([
...function*() {
var _loop__7 = function*(i__4) {
Promise.resolve().then(()=>{
console.log(`async: ${i__4}`);
});
yield i__4;
};
for (var i__4 of [
1,
2,
3
])yield* _loop__7(i__4);
}()
]);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_compat/tests/block-scoping/issue-4286/2/input.js | JavaScript | for (const i of [1, 2, 3]) {
Promise.resolve().then(() => {
console.log(`async: ${i}`);
});
} | 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.