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_preset_env/tests/fixtures/corejs3/usage-object-spread/output.mjs | JavaScript | a = {
b: b,
...c
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-old-core-js/input.mjs | JavaScript | "asad".at();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-old-core-js/output.mjs | JavaScript | "asad".at();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-promise-all/input.mjs | JavaScript | var p = Promise.resolve(0);
Promise.all([p]).then((outcome) => {
alert("OK");
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-promise-all/output.mjs | JavaScript | import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.promise.js";
import "core-js/modules/es.string.iterator.js";
import "core-js/modules/web.dom-collections.iterator.js";
var p = Promise.resolve(0);
Promise.all([
p
]).then(function(outcome) {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-promise-finally/input.mjs | JavaScript | var p = Promise.resolve(0);
p.finally(() => {
alert("OK");
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-promise-finally/output.mjs | JavaScript | import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.promise.finally.js";
import "core-js/modules/es.promise.js";
var p = Promise.resolve(0);
p.finally(function() {
alert("OK");
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-promise-race/input.mjs | JavaScript | var p = Promise.resolve(0);
Promise.race([p]).then((outcome) => {
alert("OK");
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-promise-race/output.mjs | JavaScript | import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.promise.js";
import "core-js/modules/es.string.iterator.js";
import "core-js/modules/web.dom-collections.iterator.js";
var p = Promise.resolve(0);
Promise.race([
p
]).then(function(outcome) {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-regexp/input.mjs | JavaScript | const a = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/u;
const b = /./s;
const c = /./imsuy;
console.log(a.unicode);
console.log(b.dotAll);
console.log(c.sticky);
console.log(c.ignoreCase);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-regexp/output.mjs | JavaScript | import "core-js/modules/es.regexp.constructor.js";
import "core-js/modules/es.regexp.exec.js";
import "core-js/modules/es.regexp.to-string.js";
var a = RegExp("(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})", "u");
var b = RegExp(".", "s");
var c = RegExp(".", "imsuy");
console.log(a.unicode);
console.log(b.dotAll);
c... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-source-type-script-query/input.js | JavaScript | require("foo");
const x = new Promise((resolve) => {
const p = [];
if (p.includes("a")) {
}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-source-type-script-query/output.js | JavaScript | require("core-js/modules/es.array.includes");
require("core-js/modules/es.object.to-string");
require("core-js/modules/es.promise");
require("foo");
var x = new Promise(function (resolve) {
var p = [];
if (p.includes("a")) {}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-source-type-script/input.js | JavaScript | require("foo");
const x = new Promise((resolve) => {
const p = [];
if (p.includes("a")) {
}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-source-type-script/output.js | JavaScript | require("core-js/modules/es.array.includes");
require("core-js/modules/es.object.to-string");
require("core-js/modules/es.promise");
require("foo");
var x = new Promise(function (resolve) {
var p = [];
if (p.includes("a")) {}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-spread/input.mjs | JavaScript | a = [b, ...c];
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-spread/output.mjs | JavaScript | import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.string.iterator.js";
import "core-js/modules/web.dom-collections.iterator.js";
a = [
b,
...c
];
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-static-methods-native-support/input.mjs | JavaScript | Object.keys(foo);
const getOwnPropertySymbols = Object.getOwnPropertySymbols;
const { assign } = Object;
"defineProperty" in Object;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-static-methods-native-support/output.mjs | JavaScript | Object.keys(foo);
const getOwnPropertySymbols = Object.getOwnPropertySymbols;
const { assign } = Object;
"defineProperty" in Object;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-static-methods/input.mjs | JavaScript | Object.keys(foo);
const getOwnPropertySymbols = Object.getOwnPropertySymbols;
const { assign } = Object;
"defineProperty" in Object;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-static-methods/output.mjs | JavaScript | import "core-js/modules/es.object.assign.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.symbol.js";
Object.keys(foo);
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var { assign } = Object;
"defineProperty" in Object;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-symbol-iterator-in/input.mjs | JavaScript | Symbol.iterator in arr;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-symbol-iterator-in/output.mjs | JavaScript | import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.string.iterator.js";
import "core-js/modules/es.symbol.description.js";
import "core-js/modules/es.symbol.iterator.js";
import "core-js/modules/es.symbol.js";
import "core-js/modules/web.dom-collec... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-symbol-iterator/input.mjs | JavaScript | arr[Symbol.iterator]();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-symbol-iterator/output.mjs | JavaScript | import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.string.iterator.js";
import "core-js/modules/es.symbol.description.js";
import "core-js/modules/es.symbol.iterator.js";
import "core-js/modules/es.symbol.js";
import "core-js/modules/web.dom-collec... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-timers/input.mjs | JavaScript | Promise.resolve().then((it) => {
setTimeout(foo, 1, 2);
setInterval(foo, 1, 2);
setImmediate(foo, 1, 2);
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-timers/output.mjs | JavaScript | import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.promise.js";
import "core-js/modules/web.immediate.js";
import "core-js/modules/web.timers.js";
Promise.resolve().then(function(it) {
setTimeout(foo, 1, 2);
setInterval(foo, 1, 2);
setImmediate(foo, 1, 2);
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-typed-array-edge-13/input.mjs | JavaScript | new Int8Array(1);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-typed-array-edge-13/output.mjs | JavaScript | import "core-js/modules/es.array-buffer.constructor.js";
import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.typed-array.fill.js";
import "core-js/modules/es.typed-array.includes.js";
import "core-js/modules/es.typed-array.int8-array.js";
import "co... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-typed-array-static/input.mjs | JavaScript | Int8Array.of();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-typed-array-static/output.mjs | JavaScript | import "core-js/modules/es.array-buffer.constructor.js";
import "core-js/modules/es.array-buffer.slice.js";
import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.data-view.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.typed-array.copy-within.js";
import "core-js/mo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-typed-array/input.mjs | JavaScript | new Int8Array(1);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-typed-array/output.mjs | JavaScript | import "core-js/modules/es.array-buffer.constructor.js";
import "core-js/modules/es.array-buffer.slice.js";
import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.data-view.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.typed-array.copy-within.js";
import "core-js/mo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-yield-non-star/input.mjs | JavaScript | function* a() {
yield 1;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-yield-non-star/output.mjs | JavaScript | function* a() {
yield 1;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-yield-star/input.mjs | JavaScript | function* a() {
yield* 1;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-yield-star/output.mjs | JavaScript | import "core-js/modules/es.array.iterator.js";
import "core-js/modules/web.dom-collections.iterator.js";
function* a() {
yield* 1;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/transform/static-block/input.mjs | JavaScript | class A {
static {
this.abc = 123;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/transform/static-block/output.mjs | JavaScript | class A {
}
A.abc = 123;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/transform/tp-version/input.mjs | JavaScript | class A {
static {
this.abc = 123;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/fixtures/transform/tp-version/output.mjs | JavaScript | class A {
}
A.abc = 123;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_preset_env/tests/test.rs | Rust | #![allow(dead_code)]
use std::{
cmp::Ordering,
env,
fs::File,
io,
io::Read,
path::{Path, PathBuf},
};
use pretty_assertions::assert_eq;
use rustc_hash::FxHashMap;
use serde::Deserialize;
use serde_json::Value;
use swc_common::{
comments::SingleThreadedComments, errors::HANDLER, input::Stri... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote/src/clone.rs | Rust | //! Module for implicitly copyable types.
/// Noop
pub trait ImplicitClone: Clone {
fn clone_quote_var(&self) -> Self {
self.clone()
}
}
impl<T: Clone> ImplicitClone for T {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote/src/lib.rs | Rust | /// Not a public API.
#[doc(hidden)]
pub extern crate swc_common;
/// Not a public API.
#[doc(hidden)]
pub extern crate swc_ecma_ast;
/// Not a public API.
#[doc(hidden)]
pub extern crate swc_ecma_quote_macros;
#[doc(hidden)]
pub use self::clone::ImplicitClone;
mod clone;
/// # Supported output types
///
/// - `Exp... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/class.rs | Rust | use swc_ecma_ast::*;
impl_struct!(
Class,
[
span,
ctxt,
decorators,
body,
super_class,
is_abstract,
type_params,
super_type_params,
implements
]
);
impl_struct!(
Constructor,
[span, ctxt, key, params, body, accessibility, is_o... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/decl.rs | Rust | use swc_ecma_ast::*;
impl_enum!(
Decl,
[
Class,
Fn,
Var,
TsInterface,
TsTypeAlias,
TsEnum,
TsModule,
Using
]
);
impl_struct!(ClassDecl, [ident, declare, class]);
impl_struct!(FnDecl, [ident, declare, function]);
impl_struct!(VarDecl, [span, c... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/enums.rs | Rust | use swc_ecma_ast::*;
use syn::parse_quote;
macro_rules! impl_simple_enum {
($E:ident, [ $($v:ident),* ]) => {
impl crate::ast::ToCode for $E {
fn to_code(&self, _: &crate::ctxt::Ctx) -> syn::Expr {
match self {
$(
$E::$v => parse_quote... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/expr.rs | Rust | use swc_ecma_ast::*;
impl_enum!(AssignTarget, [Simple, Pat], true);
impl_enum!(
SimpleAssignTarget,
[
Ident,
Member,
SuperProp,
Paren,
OptChain,
TsAs,
TsNonNull,
TsSatisfies,
TsTypeAssertion,
TsInstantiation,
Invalid
]
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/id.rs | Rust | use swc_ecma_ast::*;
use syn::parse_quote;
use super::ToCode;
use crate::ctxt::Ctx;
impl ToCode for swc_ecma_ast::Ident {
fn to_code(&self, cx: &Ctx) -> syn::Expr {
if let Some(var_name) = self.sym.strip_prefix('$') {
if let Some(var) = cx.var(crate::ctxt::VarPos::Ident, var_name) {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/lit.rs | Rust | use proc_macro2::Span;
use swc_atoms::Atom;
use swc_ecma_ast::*;
use syn::{parse_quote, ExprLit, LitBool, LitFloat};
use super::ToCode;
use crate::{builder::Builder, ctxt::Ctx};
fail_todo!(BigInt);
fail_todo!(JSXText);
impl ToCode for Str {
fn to_code(&self, cx: &crate::ctxt::Ctx) -> syn::Expr {
if let S... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/mod.rs | Rust | use swc_common::{Span, SyntaxContext};
use swc_ecma_ast::*;
use syn::{parse_quote, ExprBlock};
use crate::ctxt::Ctx;
macro_rules! fail_todo {
($T:ty) => {
impl crate::ast::ToCode for $T {
fn to_code(&self, _: &crate::ctxt::Ctx) -> syn::Expr {
todo!("ToCode for {}", stringify!($... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/module_decl.rs | Rust | use swc_ecma_ast::*;
impl_enum!(
ModuleDecl,
[
Import,
ExportDecl,
ExportNamed,
ExportDefaultDecl,
ExportDefaultExpr,
ExportAll,
TsImportEquals,
TsExportAssignment,
TsNamespaceExport
]
);
impl_struct!(ImportDecl, [span, specifiers, sr... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/pat.rs | Rust | use swc_ecma_ast::*;
impl_struct!(BindingIdent, [id, type_ann]);
impl_struct!(ArrayPat, [span, elems, optional, type_ann]);
impl_struct!(ObjectPat, [span, props, optional, type_ann]);
impl_struct!(RestPat, [span, dot3_token, arg, type_ann]);
impl_struct!(AssignPat, [span, left, right]);
impl_struct!(Param, [span, deco... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/prop.rs | Rust | use swc_ecma_ast::*;
impl_enum!(Prop, [Shorthand, KeyValue, Assign, Getter, Setter, Method]);
impl_struct!(
PrivateProp,
[
span,
ctxt,
definite,
key,
value,
type_ann,
is_static,
decorators,
accessibility,
is_optional,
is_o... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/stmt.rs | Rust | use swc_ecma_ast::*;
impl_enum!(
Stmt,
[
Block, Empty, Debugger, With, Return, Labeled, Break, Continue, If, Switch, Throw, Try,
While, DoWhile, For, ForIn, ForOf, Decl, Expr
]
);
impl_struct!(EmptyStmt, [span]);
impl_struct!(BlockStmt, [span, ctxt, stmts]);
impl_struct!(DebuggerStmt, [spa... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ast/typescript.rs | Rust | use swc_ecma_ast::*;
fail_todo!(TsInterfaceDecl);
fail_todo!(TsTypeAliasDecl);
fail_todo!(TsEnumDecl);
fail_todo!(TsModuleDecl);
fail_todo!(TsImportEqualsDecl);
fail_todo!(TsExportAssignment);
fail_todo!(TsNamespaceExportDecl);
fail_todo!(TsTypeAssertion);
fail_todo!(TsConstAssertion);
fail_todo!(TsNonNullExpr);
fail_... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/builder.rs | Rust | use proc_macro2::Span;
use syn::{punctuated::Punctuated, Expr, ExprStruct, FieldValue, Ident, Member, Token};
pub(crate) struct Builder {
type_name: syn::Ident,
fields: Punctuated<FieldValue, Token![,]>,
}
impl Builder {
pub fn new(ident: &str) -> Self {
Self {
type_name: Ident::new(id... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ctxt.rs | Rust | #![allow(unused)]
use std::cell::RefCell;
use rustc_hash::FxHashMap;
use swc_macros_common::call_site;
use syn::{parse_quote, punctuated::Punctuated, ExprPath, ExprReference, Ident, Token};
use crate::{ast::ToCode, input::QuoteVar};
#[derive(Debug)]
pub(crate) struct Ctx {
pub(crate) vars: FxHashMap<VarPos, Var... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/input.rs | Rust | use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
Token,
};
pub(super) struct QuoteInput {
pub src: syn::LitStr,
#[allow(unused)]
pub as_token: Token![as],
pub output_type: syn::Type,
pub vars: Option<(Token![,], Punctuated<QuoteVar, Token![,]>)>,
}
pub(super) struct Quo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/lib.rs | Rust | extern crate proc_macro;
use std::iter::once;
use quote::ToTokens;
use syn::{Block, ExprBlock};
use crate::{
ast::ToCode,
ctxt::{prepare_vars, Ctx},
input::QuoteInput,
ret_type::parse_input_type,
};
mod ast;
mod builder;
mod ctxt;
mod input;
mod ret_type;
/// Don't invoke this macro directly, use t... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_quote_macros/src/ret_type.rs | Rust | use std::any::type_name;
use anyhow::{anyhow, bail, Context, Error};
use swc_common::{sync::Lrc, FileName, SourceMap};
use swc_ecma_ast::{AssignTarget, EsVersion};
use swc_ecma_parser::{lexer::Lexer, PResult, Parser, StringInput};
use syn::{GenericArgument, PathArguments, Type};
use crate::{ast::ToCode, ctxt::Ctx};
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_testing/src/lib.rs | Rust | use std::{env, fs, path::PathBuf, process::Command};
use anyhow::{bail, Context, Result};
use sha2::{Digest, Sha256};
use testing::CARGO_TARGET_DIR;
use tracing::debug;
#[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct JsExecOptions {
/// Cache the result of the execution.
///
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/scripts/del.py | Python | #!/usr/bin/python3
import shutil
from os import listdir
from os.path import isfile, join
def search(dir):
print('Searching ', dir)
entries = listdir(dir)
if len(entries) == 1 and 'fixtures' in dir:
shutil.rmtree(dir, ignore_errors=True)
return True
if len(entries) == 2 and 'fixtures... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/scripts/del.sh | Shell | #!/usr/bin/env bash
find ./fixtures -type d -empty -delete
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
python3 $SCRIPT_DIR/del.py | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/scripts/fixtures.py | Python | #!/usr/bin/env python3
from os import listdir
from os.path import isfile, join
files = [f for f in listdir('./fixtures') if isfile(join('./fixtures', f))]
fm = {}
for f in files:
name = join('./fixtures', f)
if '.DS_Store' in f:
continue
test_name, file_type = f.rsplit('_', 1)
if file_type ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/scripts/fixtures.sh | Shell | #!/bin/bash
set -e
rm -rf /tmp/.swc
mkdir -p /tmp/.swc/fixtures
(cd fixtures && find . -depth -exec sh -c '
for source; do
case $source in ./*/*)
target="$(printf %sz "${source#./}" | tr / _)";
cp -r -- "$source" "/tmp/.swc/fixtures/${target%z}";;
esac
done
' _ {} +)
# (cd fixture... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/scripts/helpers.sh | Shell | #!/usr/bin/bash
rm -f *.js
cp ../../node_modules/@babel/runtime/helpers/*.js .
# camelCase to snake case
rename -f 's/([a-z])([A-Z])/$1_$2/g; y/A-Z/a-z/' *.js
rename --prepend=_ *.js
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/src/lib.rs | Rust | #![deny(clippy::all)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(unused)]
pub use swc_ecma_transforms_base::{
assumptions::Assumptions, feature, fixer, helpers, hygiene, perf, resolver,
};
// TODO: May remove these reexports once swc_core directly reexports all
#[cfg(feature = "swc_ecma_transforms_compat")]
#[... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/duplicated_keys_computed_keys_same_ast.js | JavaScript | let Foo = _decorate([
(_)=>desc = _
], function(_initialize) {
class Foo {
constructor(){
_initialize(this);
}
}
return {
F: Foo,
d: [
{
kind: "method",
key: getKey(),
value: function() {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/duplicated_keys_computed_keys_same_value.js | JavaScript | let Foo = _decorate([
(_)=>desc = _
], function(_initialize) {
class Foo {
constructor(){
_initialize(this);
}
}
return {
F: Foo,
d: [
{
kind: "method",
key: getKeyI(),
value: function() {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/function_name_eval.js | JavaScript | var a = {
eval: function _eval() {
return eval;
}
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/function_name_modules.js | JavaScript | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _events = /*#__PURE__*/ _interop_require_default(require("events"));
let Template = /*#__PURE__*/ function() {
"use strict";
function Template() {
_class_call_check(this, Template);
}
_create_class(Template, [
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/issue_395_1.js | JavaScript | "use strict";
var _moduleA = require("./moduleA.js");
let Demo = _decorate([
(0, _moduleA.default)('0.0.1')
], function(_initialize) {
class Demo {
constructor(){
_initialize(this);
this.author = 'alan';
}
}
return {
F: Demo,
d: []
};
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/issue_395_2.js | JavaScript | "use strict";
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
const Test = (version)=>{
return (target)=>{
target.version = version;
};
};
var _default = Test;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/issue_846_1.js | JavaScript | let SomeClass = _decorate([], function(_initialize) {
class SomeClass {
constructor(){
_initialize(this);
}
}
return {
F: SomeClass,
d: [
{
kind: "method",
decorators: [
dec
],
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/misc_method_name_not_shadow.js | JavaScript | var method = 1;
let Foo = _decorate([
decorator
], function(_initialize) {
class Foo {
constructor(){
_initialize(this);
}
}
return {
F: Foo,
d: [
{
kind: "method",
key: "method",
value: function meth... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_arguments.js | JavaScript | let A = _decorate([
dec(a, b, ...c)
], function(_initialize) {
class A {
constructor(){
_initialize(this);
}
}
return {
F: A,
d: [
{
kind: "method",
decorators: [
dec(a, b, ...c)
]... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_declaration.js | JavaScript | let A = _decorate([
dec()
], function(_initialize) {
class A {
constructor(){
_initialize(this);
}
}
return {
F: A,
d: []
};
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_export_default_anonymous.js | JavaScript | export default _decorate([
dec()
], function(_initialize) {
class _class {
constructor(){
_initialize(this);
}
}
return {
F: _class,
d: []
};
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_export_default_named.js | JavaScript | let Foo = _decorate([
dec()
], function(_initialize) {
class Foo {
constructor(){
_initialize(this);
}
}
return {
F: Foo,
d: []
};
});
export { Foo as default };
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_expression.js | JavaScript | _decorate([
dec()
], function(_initialize) {
class _class {
constructor(){
_initialize(this);
}
}
return {
F: _class,
d: []
};
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_extends.js | JavaScript | let A = _decorate([
dec
], function(_initialize, _B) {
class A extends _B {
constructor(...args){
super(...args);
_initialize(this);
}
}
return {
F: A,
d: []
};
}, B);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_extends_await.js | JavaScript | async function g() {
let A = _decorate([
dec
], function(_initialize, _super) {
class A extends _super {
constructor(...args){
super(...args);
_initialize(this);
}
}
return {
F: A,
d: []
};
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_extends_yield.js | JavaScript | function* g() {
let A = _decorate([
dec
], function(_initialize, _super) {
class A extends _super {
constructor(...args){
super(...args);
_initialize(this);
}
}
return {
F: A,
d: []
};
}, ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_initiailzer_after_super_bug_8808.js | JavaScript | let Sub = _decorate([
decorator(parameter)
], function(_initialize, _Super) {
class Sub extends _Super {
constructor(){
[
super(),
_initialize(this)
][0].method();
}
}
return {
F: Sub,
d: []
};
}, Super);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_initialize_after_super_bug_8931.js | JavaScript | let B = _decorate([
dec
], function(_initialize, _A) {
class B extends _A {
constructor(){
super(), _initialize(this);
[];
}
}
return {
F: B,
d: []
};
}, A);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_initialize_after_super_expression.js | JavaScript | let B = _decorate([
dec
], function(_initialize, _A) {
class B extends _A {
constructor(){
super(), _initialize(this);
}
}
return {
F: B,
d: []
};
}, A);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_initialize_after_super_multiple.js | JavaScript | let B = _decorate([
dec
], function(_initialize, _A) {
class B extends _A {
constructor(){
const foo = ()=>{
super(), _initialize(this);
};
if (a) {
super(), _initialize(this);
} else {
foo();
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_initialize_after_super_statement.js | JavaScript | let B = _decorate([
dec
], function(_initialize, _A) {
class B extends _A {
constructor(){
super(), _initialize(this);
}
}
return {
F: B,
d: []
};
}, A);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/decorators.rs/transformation_only_decorated.js | JavaScript | class B {
bar() {}
constructor(){
this.foo = 2;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/assign.js | JavaScript | number = function number1(x) {
return x;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/basic.js | JavaScript | var number = function number(x) {
return x;
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/class_simple.js | JavaScript | var Foo = function() {
var Foo = function Foo1() {
_class_call_check(this, Foo);
};
_define_property(Foo, 'num', 0);
return Foo;
}();
expect(Foo.num).toBe(0);
expect(Foo.num = 1).toBe(1);
expect(Foo.name).toBe('Foo');
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_await.js | JavaScript | export { };
var obj = {
await: function _await() {}
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_basic.js | JavaScript | var g = function g() {
doSmth();
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_collisions.js | JavaScript | var obj = {
search: function search({ search }) {
console.log(search);
}
};
function search({ search }) {
console.log(search);
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_method_definition.js | JavaScript | ({
x () {}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_modules_3.js | JavaScript | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return Login;
}
});
var _store = require("./store");
let Login = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/issue_288_01.js | JavaScript | var extendStatics = function extendStatics1(d, b) {
extendStatics = Object.setPrototypeOf || ({
__proto__: []
}) instanceof Array && function(d, b) {
d.__proto__ = b;
} || function(d, b) {
for(var p in b)if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/issues_5004.js | JavaScript | export const x = ({ x })=>x;
export const y = function y() {};
| 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.