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_minifier/tests/fixture/issues/7839/1/output.js
JavaScript
export function createCaseFirst(g, methodName) { var chr = g.get(0); return console.log(123), chr[methodName]() + trailing; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/7847/input.js
JavaScript
function requireState() { if (hasRequiredState) return state; hasRequiredState = 1; return state = { getHighWaterMark: function(o) { return o.objectMode ? 16 : 16384; } }; } if (g()) { var state, hasRequiredState; const a = requireState() console.log(a.getHighWaterMark()) const b = requireState() console.log(b.getHighWaterMark()) }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/7847/output.js
JavaScript
function requireState() { return hasRequiredState ? state : (hasRequiredState = 1, state = { getHighWaterMark: function(o) { return o.objectMode ? 16 : 16384; } }); } if (g()) { var state, hasRequiredState; console.log(requireState().getHighWaterMark()), console.log(requireState().getHighWaterMark()); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/7969/input.js
JavaScript
let a = 0; function f(arr) { let b = a; return `${arr.map((child) => { a = b + "str"; })}`; } function g(arr) { return f(arr); } globalThis.g = g; g([1, 2, 3]) console.log(a);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/7969/output.js
JavaScript
let a = 0; function f(arr) { let b = a; return `${arr.map((child)=>{ a = b + "str"; })}`; } function g(arr) { return f(arr); } globalThis.g = g; g([ 1, 2, 3 ]); console.log(a);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/7984/input.js
JavaScript
getInitialProps = (code) => { let statusCode, message; if (code) { statusCode = code; } switch (statusCode) { case 404: message = "404"; break; default: message = "500"; } return { statusCode, message }; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/7984/output.js
JavaScript
getInitialProps = (code)=>{ let statusCode, message; return code && (statusCode = code), message = 404 === statusCode ? "404" : "500", { statusCode, message }; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8119/input.js
JavaScript
const myArr = []; // function with side effect function foo(arr) { arr.push('foo'); return 'foo'; } let a; if (Math.random() > 0.5) { a = true; } // the function call below should always run // regardless of whether `a` is `undefined` let b = foo(myArr); // const seems to keep this line here instead of // moving it behind the logitcal nullish assignment // const b = foo(myArr); a ??= b; console.log(a); console.log(myArr);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8119/output.js
JavaScript
let a; const myArr = []; // function with side effect function foo(arr) { return arr.push('foo'), 'foo'; } Math.random() > 0.5 && (a = !0); // the function call below should always run // regardless of whether `a` is `undefined` let b = foo(myArr); // const seems to keep this line here instead of // moving it behind the logitcal nullish assignment // const b = foo(myArr); a ??= b; console.log(a); console.log(myArr);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8136/input.js
JavaScript
export class Foo { static { } foo = 2; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8136/output.js
JavaScript
export class Foo { foo = 2; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8161/input.js
JavaScript
function run(flag, output = "a output") { if (flag === "b") { output = "b output"; } console.log(output); } run("a"); run("b");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8161/output.js
JavaScript
function run(flag, output = "a output") { "b" === flag && (output = "b output"), console.log(output); } run("a"), run("b");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8173/input.js
JavaScript
"use strict"; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } const someFn = (xx, x, y) => [ x, y ]; const getArray = () => [ 1, 2, 3 ]; const goodFunction = function () { var _ref = _async_to_generator(function* () { const rb = yield getArray(); const rc = yield getArray(); console.log(someFn(1, rb, rc)); }); return function goodFunction() { return _ref.apply(this, arguments); }; }(); const badFunction = function () { var _ref = _async_to_generator(function* () { console.log(someFn(1, (yield getArray()), (yield getArray()))); }); return function badFunction() { return _ref.apply(this, arguments); }; }(); goodFunction(); badFunction();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8173/output.js
JavaScript
"use strict"; var _ref, _ref1; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg), value = info.value; } catch (error) { reject(error); return; } info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw); } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(void 0); }); }; } const someFn = (xx, x, y)=>[ x, y ], getArray = ()=>[ 1, 2, 3 ], goodFunction = (_ref = _async_to_generator(function*() { console.log(someFn(1, (yield getArray()), (yield getArray()))); }), function() { return _ref.apply(this, arguments); }), badFunction = (_ref1 = _async_to_generator(function*() { console.log(someFn(1, (yield getArray()), (yield getArray()))); }), function() { return _ref1.apply(this, arguments); }); goodFunction(), badFunction();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8228/input.js
JavaScript
export const a = `You\'ll` export const b = 'You\'ll'
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8228/output.js
JavaScript
export const a = "You'll"; export const b = 'You\'ll';
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8271/input.js
JavaScript
let $eb2fd35624c84372$var$A = (() => { let _classDecorators = [$eb2fd35624c84372$var$CustomElement("component-a")]; let _classDescriptor; let _classExtraInitializers = []; let _classThis; let _classSuper = HTMLElement; var A = class extends _classSuper { static { _classThis = this; } static { console.log(123); } constructor() { super(); this.innerHTML = "Component A is working"; } }; return (A = _classThis); })(); console.log(new $eb2fd35624c84372$var$A().tagName);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8271/output.js
JavaScript
console.log(new ((()=>{ let _classThis; $eb2fd35624c84372$var$CustomElement("component-a"); let _classSuper = HTMLElement; return class extends _classSuper { static{ _classThis = this; } static{ console.log(123); } constructor(){ super(), this.innerHTML = "Component A is working"; } }, _classThis; })())().tagName);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8284/input.js
JavaScript
(function (global, factory) { typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : ((global = typeof globalThis !== "undefined" ? globalThis : global || self), factory((global.Sentry = {}))); })(this, function (exports) { "use strict"; function isGlobalObj(obj) { return obj && obj.Math == Math ? obj : undefined; } const GLOBAL_OBJ = (typeof globalThis == "object" && isGlobalObj(globalThis)) || // eslint-disable-next-line no-restricted-globals isGlobalObj(globalThis) || (typeof self == "object" && isGlobalObj(self)) || (typeof global == "object" && isGlobalObj(global)) || (function () { return this; })() || {}; function getGlobalObject() { return GLOBAL_OBJ; } const WINDOW$6 = getGlobalObject(); function supportsFetch() { if (!("fetch" in WINDOW$6)) { return false; } return true; } console.log(supportsFetch()); });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8284/output.js
JavaScript
var global1, factory; global1 = this, factory = function(exports1) { function isGlobalObj(obj) { return obj && obj.Math == Math ? obj : void 0; } "use strict"; console.log("fetch" in ("object" == typeof globalThis && isGlobalObj(globalThis) || // eslint-disable-next-line no-restricted-globals isGlobalObj(globalThis) || "object" == typeof self && isGlobalObj(self) || "object" == typeof global && isGlobalObj(global) || function() { return this; }() || {})); }, "object" == typeof exports && "undefined" != typeof module ? factory(exports) : "function" == typeof define && define.amd ? define([ "exports" ], factory) : factory((global1 = "undefined" != typeof globalThis ? globalThis : global1 || self).Sentry = {});
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8324/input.js
JavaScript
function Deferred() { const deferred = this; deferred.promise = new Promise(function (resolve, reject) { deferred.resolve = resolve; deferred.reject = reject; }); } export async function bug() { const s = `next`; if (!window[s]) { for (window[s] = new Deferred(); ;) if (window.current) await window.current.promise; else { window.current = window[s]; try { return await window[s].promise // This line compressed to 'break'. I guess compressor intended jump to 23 line which is looks like same code. } finally { delete window.current // Above 'break' makes unintended delete } } } return await window[s].promise }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8324/output.js
JavaScript
function Deferred() { const deferred = this; deferred.promise = new Promise(function(resolve, reject) { deferred.resolve = resolve; deferred.reject = reject; }); } export async function bug() { const s = "next"; if (!window[s]) { for(window[s] = new Deferred();;)if (window.current) await window.current.promise; else { window.current = window[s]; try { return await window[s].promise // This line compressed to 'break'. I guess compressor intended jump to 23 line which is looks like same code. ; } finally{ delete window.current // Above 'break' makes unintended delete ; } } } return await window[s].promise; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8337/input.js
JavaScript
export function allowInAnd(callback) { var flags = this.prodParam.currentFlags(); var prodParamToSet = ParamKind.PARAM_IN & ~flags; if (prodParamToSet) { this.prodParam.enter(flags | ParamKind.PARAM_IN); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8337/output.js
JavaScript
export function allowInAnd(callback) { var flags = this.prodParam.currentFlags(); var prodParamToSet = ParamKind.PARAM_IN & ~flags; if (prodParamToSet) { this.prodParam.enter(flags | ParamKind.PARAM_IN); try { return callback(); } finally{ this.prodParam.exit(); } } return callback(); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8398/input.js
JavaScript
(obj?.a).b;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8398/output.js
JavaScript
(obj?.a).b;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8465/input.js
JavaScript
function Infinity() { console.log("xxx"); } export default Infinity;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8465/output.js
JavaScript
export default function() { console.log("xxx"); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8567/input.js
JavaScript
const templatePath = () => { const undefined = "lol1"; return undefined; }; console.log(templatePath());
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8567/output.js
JavaScript
console.log("lol1");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8622/input.js
JavaScript
export function foo(cond) { let reserved = 1; if (cond) { reserved = 2; } return [reserved, bar(cond)]; } function bar(cond) { let reserved = 1; if (cond) { reserved = 2; } return reserved; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8622/output.js
JavaScript
export function foo(e) { let reserved = 1; return e && (reserved = 2), [ reserved, function(e) { let reserved = 1; return e && (reserved = 2), reserved; }(e) ]; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8626/input.js
JavaScript
export function foo(cb) { cb(); } foo((a, b) => true);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8626/output.js
JavaScript
export function foo(cb) { cb(); } foo(()=>!0);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8643/input.js
JavaScript
const Cache = { enabled: false, files: {}, add: function (key, file) { if (this.enabled === false) return; // console.log( 'THREE.Cache', 'Adding key:', key ); this.files[key] = file; }, get: function (key) { if (this.enabled === false) return; // console.log( 'THREE.Cache', 'Checking key:', key ); return this.files[key]; }, remove: function (key) { delete this.files[key]; }, clear: function () { this.files = {}; } }; class Loader { constructor(manager) { this.manager = (manager !== undefined) ? manager : DefaultLoadingManager; this.crossOrigin = 'anonymous'; this.withCredentials = false; this.path = ''; this.resourcePath = ''; this.requestHeader = {}; } load( /* url, onLoad, onProgress, onError */) { } loadAsync(url, onProgress) { const scope = this; return new Promise(function (resolve, reject) { scope.load(url, resolve, onProgress, reject); }); } parse( /* data */) { } setCrossOrigin(crossOrigin) { this.crossOrigin = crossOrigin; return this; } setWithCredentials(value) { this.withCredentials = value; return this; } setPath(path) { this.path = path; return this; } setResourcePath(resourcePath) { this.resourcePath = resourcePath; return this; } setRequestHeader(requestHeader) { this.requestHeader = requestHeader; return this; } } Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT'; const loading = {}; class HttpError extends Error { constructor(message, response) { super(message); this.response = response; } } export class FileLoader extends Loader { constructor(manager) { super(manager); } load(url, onLoad, onProgress, onError) { if (url === undefined) url = ''; if (this.path !== undefined) url = this.path + url; url = this.manager.resolveURL(url); const cached = Cache.get(url); if (cached !== undefined) { this.manager.itemStart(url); setTimeout(() => { if (onLoad) onLoad(cached); this.manager.itemEnd(url); }, 0); return cached; } // Check if request is duplicate if (loading[url] !== undefined) { loading[url].push({ onLoad: onLoad, onProgress: onProgress, onError: onError }); return; } // Initialise array for duplicate requests loading[url] = []; loading[url].push({ onLoad: onLoad, onProgress: onProgress, onError: onError, }); // create request const req = new Request(url, { headers: new Headers(this.requestHeader), credentials: this.withCredentials ? 'include' : 'same-origin', // An abort controller could be added within a future PR }); // record states ( avoid data race ) const mimeType = this.mimeType; const responseType = this.responseType; // start the fetch fetch(req) .then(response => { if (response.status === 200 || response.status === 0) { // Some browsers return HTTP Status 0 when using non-http protocol // e.g. 'file://' or 'data://'. Handle as success. if (response.status === 0) { console.warn('THREE.FileLoader: HTTP Status 0 received.'); } // Workaround: Checking if response.body === undefined for Alipay browser #23548 if (typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined) { return response; } const callbacks = loading[url]; const reader = response.body.getReader(); // Nginx needs X-File-Size check // https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content const contentLength = response.headers.get('Content-Length') || response.headers.get('X-File-Size'); const total = contentLength ? parseInt(contentLength) : 0; const lengthComputable = total !== 0; let loaded = 0; // periodically read data into the new stream tracking while download progress const stream = new ReadableStream({ start(controller) { readData(); function readData() { reader.read().then(({ done, value }) => { if (done) { controller.close(); } else { loaded += value.byteLength; const event = new ProgressEvent('progress', { lengthComputable, loaded, total }); for (let i = 0, il = callbacks.length; i < il; i++) { const callback = callbacks[i]; if (callback.onProgress) callback.onProgress(event); } controller.enqueue(value); readData(); } }); } } }); return new Response(stream); } else { throw new HttpError(`fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`, response); } }) .then(response => { switch (responseType) { case 'arraybuffer': return response.arrayBuffer(); case 'blob': return response.blob(); case 'document': return response.text() .then(text => { const parser = new DOMParser(); return parser.parseFromString(text, mimeType); }); case 'json': return response.json(); default: if (mimeType === undefined) { return response.text(); } else { // sniff encoding const re = /charset="?([^;"\s]*)"?/i; const exec = re.exec(mimeType); const label = exec && exec[1] ? exec[1].toLowerCase() : undefined; const decoder = new TextDecoder(label); return response.arrayBuffer().then(ab => decoder.decode(ab)); } } }) .then(data => { // Add to cache only on HTTP success, so that we do not cache // error response bodies as proper responses to requests. Cache.add(url, data); const callbacks = loading[url]; delete loading[url]; for (let i = 0, il = callbacks.length; i < il; i++) { const callback = callbacks[i]; if (callback.onLoad) callback.onLoad(data); } }) .catch(err => { // Abort errors and other errors are handled the same const callbacks = loading[url]; if (callbacks === undefined) { // When onLoad was called and url was deleted in `loading` this.manager.itemError(url); throw err; } delete loading[url]; for (let i = 0, il = callbacks.length; i < il; i++) { const callback = callbacks[i]; if (callback.onError) callback.onError(err); } this.manager.itemError(url); }) .finally(() => { this.manager.itemEnd(url); }); this.manager.itemStart(url); } setResponseType(value) { this.responseType = value; return this; } setMimeType(value) { this.mimeType = value; return this; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8643/output.js
JavaScript
const Cache = { enabled: !1, files: {}, add: function(key, file) { !1 !== this.enabled && // console.log( 'THREE.Cache', 'Adding key:', key ); (this.files[key] = file); }, get: function(key) { if (!1 !== this.enabled) // console.log( 'THREE.Cache', 'Checking key:', key ); return this.files[key]; }, remove: function(key) { delete this.files[key]; }, clear: function() { this.files = {}; } }; class Loader { constructor(manager){ this.manager = void 0 !== manager ? manager : DefaultLoadingManager, this.crossOrigin = 'anonymous', this.withCredentials = !1, this.path = '', this.resourcePath = '', this.requestHeader = {}; } load() {} loadAsync(url, onProgress) { const scope = this; return new Promise(function(resolve, reject) { scope.load(url, resolve, onProgress, reject); }); } parse() {} setCrossOrigin(crossOrigin) { return this.crossOrigin = crossOrigin, this; } setWithCredentials(value) { return this.withCredentials = value, this; } setPath(path) { return this.path = path, this; } setResourcePath(resourcePath) { return this.resourcePath = resourcePath, this; } setRequestHeader(requestHeader) { return this.requestHeader = requestHeader, this; } } Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT'; const loading = {}; class HttpError extends Error { constructor(message, response){ super(message), this.response = response; } } export class FileLoader extends Loader { constructor(manager){ super(manager); } load(url, onLoad, onProgress, onError) { void 0 === url && (url = ''), void 0 !== this.path && (url = this.path + url), url = this.manager.resolveURL(url); const cached = Cache.get(url); if (void 0 !== cached) return this.manager.itemStart(url), setTimeout(()=>{ onLoad && onLoad(cached), this.manager.itemEnd(url); }, 0), cached; // Check if request is duplicate if (void 0 !== loading[url]) { loading[url].push({ onLoad: onLoad, onProgress: onProgress, onError: onError }); return; } // Initialise array for duplicate requests loading[url] = [], loading[url].push({ onLoad: onLoad, onProgress: onProgress, onError: onError }); // create request const req = new Request(url, { headers: new Headers(this.requestHeader), credentials: this.withCredentials ? 'include' : 'same-origin' }), mimeType = this.mimeType, responseType = this.responseType; // start the fetch fetch(req).then((response)=>{ if (200 === response.status || 0 === response.status) { // Workaround: Checking if response.body === undefined for Alipay browser #23548 if (0 === response.status && console.warn('THREE.FileLoader: HTTP Status 0 received.'), 'undefined' == typeof ReadableStream || void 0 === response.body || void 0 === response.body.getReader) return response; const callbacks = loading[url], reader = response.body.getReader(), contentLength = response.headers.get('Content-Length') || response.headers.get('X-File-Size'), total = contentLength ? parseInt(contentLength) : 0, lengthComputable = 0 !== total; let loaded = 0; return new Response(new ReadableStream({ start (controller) { (function readData() { reader.read().then(({ done, value })=>{ if (done) controller.close(); else { const event = new ProgressEvent('progress', { lengthComputable, loaded: loaded += value.byteLength, total }); for(let i = 0, il = callbacks.length; i < il; i++){ const callback = callbacks[i]; callback.onProgress && callback.onProgress(event); } controller.enqueue(value), readData(); } }); })(); } })); } throw new HttpError(`fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`, response); }).then((response)=>{ switch(responseType){ case 'arraybuffer': return response.arrayBuffer(); case 'blob': return response.blob(); case 'document': return response.text().then((text)=>new DOMParser().parseFromString(text, mimeType)); case 'json': return response.json(); default: if (void 0 === mimeType) return response.text(); { const exec = /charset="?([^;"\s]*)"?/i.exec(mimeType), decoder = new TextDecoder(exec && exec[1] ? exec[1].toLowerCase() : void 0); return response.arrayBuffer().then((ab)=>decoder.decode(ab)); } } }).then((data)=>{ // Add to cache only on HTTP success, so that we do not cache // error response bodies as proper responses to requests. Cache.add(url, data); const callbacks = loading[url]; delete loading[url]; for(let i = 0, il = callbacks.length; i < il; i++){ const callback = callbacks[i]; callback.onLoad && callback.onLoad(data); } }).catch((err)=>{ // Abort errors and other errors are handled the same const callbacks = loading[url]; if (void 0 === callbacks) throw(// When onLoad was called and url was deleted in `loading` this.manager.itemError(url), err); delete loading[url]; for(let i = 0, il = callbacks.length; i < il; i++){ const callback = callbacks[i]; callback.onError && callback.onError(err); } this.manager.itemError(url); }).finally(()=>{ this.manager.itemEnd(url); }), this.manager.itemStart(url); } setResponseType(value) { return this.responseType = value, this; } setMimeType(value) { return this.mimeType = value, this; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8670/input.js
JavaScript
const [a, b, c, d, e] = [1, 2, 3, 4, 5] console.log(c)
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8670/output.js
JavaScript
const [, , c, , , ] = [ 1, 2, 3, 4, 5 ]; console.log(c);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8692/input.js
JavaScript
const props = { neededProp: 1, nestedProp: { getProps: () => props, getProp() { return this.getProps().neededProp; }, }, }; console.log(props.nestedProp.getProp()); // should log: 1
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8692/output.js
JavaScript
const props = { neededProp: 1, nestedProp: { getProps: ()=>props, getProp () { return this.getProps().neededProp; } } }; console.log(props.nestedProp.getProp()); // should log: 1
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8704/input.js
JavaScript
console.log({ toString() { return 'swc' } } + '')
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8704/output.js
JavaScript
console.log({ toString: ()=>'swc' } + '');
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8705/input.js
JavaScript
console.log(Math.pow({ valueOf() { return 42 } }, 1))
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8705/output.js
JavaScript
console.log(Math.pow({ valueOf: ()=>42 }, 1));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8706/input.js
JavaScript
console.log([void 0] + 'swc');
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8706/output.js
JavaScript
console.log("swc");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8714/input.js
JavaScript
const foo = { x: 1, y: () => foo }; console.log(foo.y().x);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8714/output.js
JavaScript
const foo = { x: 1, y: ()=>foo }; console.log(foo.y().x);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8715/input.js
JavaScript
console.log([1, 2, 3].slice(-1)) console.log([1, 2, 3].slice(-1, 0))
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8715/output.js
JavaScript
console.log([ 1, 2, 3 ].slice(-1)), console.log([ 1, 2, 3 ].slice(-1, 0));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8717/input.js
JavaScript
console.log([,].toString());
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8717/output.js
JavaScript
console.log([ , ].toString());
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/1/input.js
JavaScript
let a = ""; console.log(((a += 1), (a += 2)));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/1/output.js
JavaScript
let a = ""; console.log((a += 1, a += 2));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/2/input.js
JavaScript
let a = 0; a = ""; console.log(((a += 1), (a += 2)));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/2/output.js
JavaScript
console.log("12");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/3/input.js
JavaScript
let a; function f() { a = "123"; console.log(a); } f(); console.log(((a += 1), (a += 2)));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/3/output.js
JavaScript
let a; console.log(a = "123"), console.log((a += 1, a += 2));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/4/input.js
JavaScript
let a; function g() { a = "123"; console.log(a); } function f() { // a = "123"; console.log(a); } f(), g(); console.log(((a += 1), (a += 2)));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/4/output.js
JavaScript
let a; // a = "123"; console.log(a), console.log(a = "123"), console.log((a += 1, a += 2));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/5/input.js
JavaScript
let a = 0; function f() { a = "123"; console.log(a); } console.log(((a += 1), (a += 2)));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/5/output.js
JavaScript
console.log(3);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/6/input.js
JavaScript
let a = 0; function g() { a = "123"; console.log(a); } function f() { // a = "123"; console.log(a); } console.log(((a += 1), (a += 2)));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/6/output.js
JavaScript
console.log(3);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/7/input.js
JavaScript
export function foo(a) { a += 1; a += 2; return a; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8718/7/output.js
JavaScript
export function foo(a) { return a += 1, a += 2; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8737/2/input.js
JavaScript
d(function () { var obj = { key: "some string" }, b = function () { return a, obj.key; }; return function () { return b; }; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js
JavaScript
d(function() { var b = function() { return a, "some string"; }; return function() { return b; }; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8737/input.js
JavaScript
d(() => { var obj = { key: "some string", }; var b = () => { switch (a) { default: break; } return obj.key; }; return () => b; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js
JavaScript
d(()=>{ var obj = { key: "some string" }, b = ()=>(a, obj.key); return ()=>b; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8806/input.js
JavaScript
function logTheNine() { ((theThree, theNine) => { console.log(theNine) })(...[3, 9]); } logTheNine();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8806/output.js
JavaScript
function logTheNine() { console.log(9); } logTheNine();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8813/input.js
JavaScript
const k1 = (() => { const x = 'asdf'; let y = "PASS 1"; switch (x) { case x: default: case y = "FAIL": } console.log(y); })(); const k2 = (() => { const x = 'asdf'; let y = "PASS 2"; switch (x) { case x: case y = "FAIL": default: } console.log(y); })(); const k3 = (() => { const x = 'asdf'; let y = "FAIL"; switch (x) { case (y = "PASS 3", x): default: } console.log(y); })(); const k4 = (() => { const x = 'asdf'; let y = "FAIL"; switch (x) { case y = "PASS 4": case x: default: } console.log(y); })(); const k5 = (() => { const x = 'asdf'; let y = "FAIL"; let z = "FAIL"; switch (x) { case y = "PASS 5": case z = "PASS 5": case x: default: } console.log(y, z); })(); var c = "FAIL"; (function () { function f(a, NaN) { function g() { switch (a) { case a: break; case ((c = "PASS"), NaN): c = "FAIL" break; } } g(); } f(0 / 0); })(); console.log(c);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8813/output.js
JavaScript
(()=>{ const x = 'asdf'; let y = "PASS 1"; switch(x){ case x: default: case y = "FAIL": } console.log(y); })(), (()=>{ const x = 'asdf'; let y = "PASS 2"; switch(x){ case x: case y = "FAIL": } console.log(y); })(), console.log("PASS 3"), console.log("PASS 4"), (()=>{ let y = "FAIL", z = "FAIL"; switch('asdf'){ case y = "PASS 5": case z = "PASS 5": } console.log(y, z); })(); var a, c = "FAIL"; a = 0 / 0, function() { switch(a){ case a: break; case void (c = "PASS"): c = "FAIL"; } }(), console.log(c);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8826/input.js
JavaScript
export function createTypeChecker(host) { return { getFlowTypeOfReference } function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = (_a2 => (_a2 = tryCast(reference, canHaveFlowNode)) == null ? void 0 : _a2.flowNode)()) { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8826/output.js
JavaScript
export function createTypeChecker(host) { return { getFlowTypeOfReference: function(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((_a2)=>null == (_a2 = tryCast(reference, canHaveFlowNode)) ? void 0 : _a2.flowNode)()) {} }; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8841/input.js
JavaScript
export const k = (() => { var x = x; return x; })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8841/output.js
JavaScript
var x; export const k = x;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8844/input.js
JavaScript
const k = (() => { let x; switch (x) { case x?.x?.(): default: } })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8844/output.js
JavaScript
let x; x?.x?.();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8880/1/input.js
JavaScript
export function a(module, exports, farmRequire, farmDynamicRequire) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _interop_require_default = farmRequire("@swc/helpers/_/_interop_require_default"); const _typeof = _interop_require_default._(farmRequire("8178b9bd")); const _dep734fea04 = farmRequire("92648bed"); const _dayjs = _interop_require_default._(farmRequire("d0dc4dad")); farmRequire("15d5169f"); var zhCn = (0, _dep734fea04.c)(function (module, exports) { !function (e, _) { module.exports = _(_dayjs.default); }(_dep734fea04.a, function (e) { "use strict"; function _(e) { return e && "object" == (0, _typeof.default)(e) && "default" in e ? e : { default: e }; } var t = _(e), d = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function ordinal(e, _) { return "W" === _ ? e + "周" : e + "日"; }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function meridiem(e, _) { var t = 100 * e + _; return t < 600 ? "凌晨" : t < 900 ? "早上" : t < 1100 ? "上午" : t < 1300 ? "中午" : t < 1800 ? "下午" : "晚上"; } }; return t.default.locale(d, null, !0), d; }); }); return zhCn }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8880/1/output.js
JavaScript
export function a(module, exports, farmRequire, farmDynamicRequire) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); const _interop_require_default = farmRequire("@swc/helpers/_/_interop_require_default"), _typeof = _interop_require_default._(farmRequire("8178b9bd")), _dep734fea04 = farmRequire("92648bed"), _dayjs = _interop_require_default._(farmRequire("d0dc4dad")); return farmRequire("15d5169f"), (0, _dep734fea04.c)(function(module, exports) { var e, t, d; _dep734fea04.a, t = (e = _dayjs.default) && "object" == (0, _typeof.default)(e) && "default" in e ? e : { default: e }, d = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e, _) { return "W" === _ ? e + "周" : e + "日"; }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e, _) { var t = 100 * e + _; return t < 600 ? "凌晨" : t < 900 ? "早上" : t < 1100 ? "上午" : t < 1300 ? "中午" : t < 1800 ? "下午" : "晚上"; } }, t.default.locale(d, null, !0), module.exports = d; }); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8886/input.js
JavaScript
const bar = ((v) => v)(1); const foo = ((v) => v)(2); eval(bar); eval(foo);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8886/output.js
JavaScript
const bar = 1, foo = 2; eval(bar), eval(foo);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8907/input.js
JavaScript
const used =/*#__PURE__*/ (0, forwardRef)(/* harden */Foo); export default used
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8907/output.js
JavaScript
const used = /*#__PURE__*/ forwardRef(/* harden */ Foo); export default used;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8919/input.js
JavaScript
"use strict"; const k = (() => { switch ("") { default: var x; case "": x; } return x; })(); console.log(k);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8919/output.js
JavaScript
"use strict"; console.log(void 0);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8923/input.js
JavaScript
"use strict"; const k = (() => { let x = ''; x *= x-- / x; return x; })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8923/output.js
JavaScript
"use strict"; const k = (()=>{ let x = ''; return x * (x-- / x); })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8924/input.js
JavaScript
"use strict"; const k = (() => { let x = 1; x **= undefined; return x; })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8924/output.js
JavaScript
"use strict"; const k = (()=>{ let x = 1; return x **= void 0; })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8953/input.js
JavaScript
"use strict"; const k = (() => { let x = 1; switch (x) { case x: async function x() {} } return x; })(); console.log(k);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8953/output.js
JavaScript
"use strict"; console.log(1);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8974/input.js
JavaScript
const one = { kind: "Document", definitions: [], loc: {} }; const two = { kind: "Document", definitions: one.definitions, }; const three = a`${one}`; export { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/8974/output.js
JavaScript
const one = { kind: "Document", definitions: [], loc: {} }; one.definitions, a`${one}`; export { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/9007/input.js
JavaScript
console.log(Math.min(-0, 0)) console.log(Math.min(0, -0)) console.log(Math.max(-0, 0)) console.log(Math.max(0, -0))
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/9007/output.js
JavaScript
console.log(-0), console.log(-0), console.log(0), console.log(0);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_minifier/tests/fixture/issues/9030/input.js
JavaScript
var FRUITS = { MANGO: "mango" }; var getMangoLabel = (label) => label[FRUITS.MANGO]; export default (name) => { // Breaks with switch case switch (name) { case FRUITS.MANGO: { return getMangoLabel } } // Works with if else // if (name === FRUITS.MANGO) { // return getMangoLabel; // } };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University