Skip to content

Commit

Permalink
Update test refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 20, 2024
1 parent a39dd1d commit 4d31b74
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 29 deletions.
2 changes: 1 addition & 1 deletion crates/swc/tests/fixture/issues-6xxx/6407/output/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default class Demo {
let ranges = [], range = [], retrString = A.encode(value), bitField = '';
return value.forEach((curValue, i)=>{
bitField += B.encode(curValue), range.push(i), ranges.push(range);
}), retrString += '.' + C.encode(ranges);
}), retrString += '.', retrString += C.encode(ranges);
}
}
console.log(Deno.encode());
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//// [compoundAdditionAssignmentLHSCanBeAssigned.ts]
var E, E1;
(E1 = E || (E = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b";
var E, a, b, x1, x2, x3, x4, x6, E1;
(E1 = E || (E = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", x1 += a, x1 += b, x1 += !0, x1 += 0, x1 += '', x1 += 0, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += b, x2 += !0, x2 += 0, x2 += '', x2 += 0, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += 0, x3 += null, x3 += void 0, x4 += a, x4 += 0, x4 += null, x4 += void 0, x6 += a, x6 += '';
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//// [compoundAdditionAssignmentWithInvalidOperands.ts]
var E, E1;
(E1 = E || (E = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b";
var E, a, x1, x2, x3, x4, x5, E1;
(E1 = E || (E = {}))[E1.a = 0] = "a", E1[E1.b = 1] = "b", x1 += a, x1 += !0, x1 += 0, x1 += {}, x1 += null, x1 += void 0, x2 += a, x2 += !0, x2 += 0, x2 += {}, x2 += null, x2 += void 0, x3 += a, x3 += !0, x3 += 0, x3 += {}, x3 += null, x3 += void 0, x4 += a, x4 += !0, x4 += {}, x5 += a, x5 += !0;
2 changes: 1 addition & 1 deletion crates/swc/tests/tsc-references/symbolType12.2.minified.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//// [symbolType12.ts]
var s = Symbol.for("assign"), str = "";
s *= 0 * s, s /= s, s /= 0, s %= s, s %= 0, s += s + 0 + "", str += s, s -= s, s -= 0, s <<= s, s <<= 0, s >>= s, s >>= 0, s >>>= s, s >>>= 0, s &= s, s &= 0, s ^= s, s ^= 0, s |= s, s |= 0, str += s || str;
s *= 0 * s, s /= s, s /= 0, s %= s, s %= 0, s += s, s += 0, s += "", str += s, s -= s, s -= 0, s <<= s, s <<= 0, s >>= s, s >>= 0, s >>>= s, s >>>= 0, s &= s, s &= 0, s ^= s, s ^= 0, s |= s, s |= 0, str += s || str;
2 changes: 1 addition & 1 deletion crates/swc_ecma_minifier/tests/benches-full/echarts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5716,7 +5716,7 @@
var width = data[i++], height = data[i++];
if (x1 = x0 + width, y1 = y0 + height, isStroke) {
if (containStroke(x0, y0, x1, y0, lineWidth, x, y) || containStroke(x1, y0, x1, y1, lineWidth, x, y) || containStroke(x1, y1, x0, y1, lineWidth, x, y) || containStroke(x0, y1, x0, y0, lineWidth, x, y)) return !0;
} else w += windingLine(x1, y0, x1, y1, x, y) + windingLine(x0, y1, x0, y0, x, y);
} else w += windingLine(x1, y0, x1, y1, x, y), w += windingLine(x0, y1, x0, y0, x, y);
break;
case CMD$1.Z:
if (isStroke) {
Expand Down
5 changes: 3 additions & 2 deletions crates/swc_ecma_minifier/tests/benches-full/moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,9 @@
getParsingFlags(config).invalidFormat = !0, config._d = new Date(NaN);
return;
}
for(i = 0; i < config._f.length; i++)currentScore = 0, validFormatFound = !1, tempConfig = copyConfig({}, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), isValid(tempConfig) && (validFormatFound = !0), //or tokens
currentScore += getParsingFlags(tempConfig).charsLeftOver + 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, bestFormatIsValid ? currentScore < scoreToBeat && (scoreToBeat = currentScore, bestMoment = tempConfig) : (null == scoreToBeat || currentScore < scoreToBeat || validFormatFound) && (scoreToBeat = currentScore, bestMoment = tempConfig, validFormatFound && (bestFormatIsValid = !0));
for(i = 0; i < config._f.length; i++)currentScore = 0, validFormatFound = !1, tempConfig = copyConfig({}, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), isValid(tempConfig) && (validFormatFound = !0), // if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver, //or tokens
currentScore += 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, bestFormatIsValid ? currentScore < scoreToBeat && (scoreToBeat = currentScore, bestMoment = tempConfig) : (null == scoreToBeat || currentScore < scoreToBeat || validFormatFound) && (scoreToBeat = currentScore, bestMoment = tempConfig, validFormatFound && (bestFormatIsValid = !0));
extend(config, bestMoment || tempConfig);
}(config) : format ? configFromStringAndFormat(config) : isUndefined(input = config._i) ? config._d = new Date(hooks.now()) : isDate(input) ? config._d = new Date(input.valueOf()) : 'string' == typeof input ? // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
function(config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class Demo {
bitField += B.encode(curValue);
range.push(i);
ranges.push(range);
}), retrString += '.' + C.encode(ranges);
}), retrString += '.', retrString += C.encode(ranges);
}
}
console.log(Deno.encode());
17 changes: 17 additions & 0 deletions crates/swc_ecma_minifier/tests/fixture/issues/9504/output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export function panUpdate(e) {
if (!moveDirectionExpected) {
panStart = !1;
return;
}
if (caf(rafIndex), panStart && (rafIndex = raf(function() {
panUpdate(e);
})), '?' === moveDirectionExpected && (moveDirectionExpected = getMoveDirectionExpected()), moveDirectionExpected) {
!preventScroll && isTouchEvent(e) && (preventScroll = !0);
try {
e.type && events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e));
} catch (err) {}
var x = translateInit, dist = getDist(lastPosition, initPosition);
!horizontal || fixedWidth || autoWidth ? (// Relevant lines below
x += dist, x += 'px') : (x += TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew) : 100 * dist / (viewport + gutter), x += '%'), container.style[transformAttr] = transformPrefix + x + transformPostfix;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@
d = !0;
}
d || (b1 = "", xa(c, function(c, d) {
b1 += d + ":" + c + "\r\n";
b1 += d, b1 += ":", b1 += c, b1 += "\r\n";
}), c = b1, "string" == typeof a ? null != c && encodeURIComponent(String(c)) : R(a, b, c));
}
function Hd(a, b, c) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@
function Wt(t) {
if (null === t.A) {
let t1 = t.path.canonicalString();
null !== t.collectionGroup && (t1 += "|cg:" + t.collectionGroup), t1 += "|f:" + t.filters.map((t)=>t.field.canonicalString() + t.op.toString() + xt(t.value)).join(",") + "|ob:" + t.orderBy.map((t)=>t.field.canonicalString() + t.dir).join(","), At(t.limit) || (t1 += "|l:" + t.limit), t.startAt && (t1 += "|lb:" + ce(t.startAt)), t.endAt && (t1 += "|ub:" + ce(t.endAt)), t.A = t1;
null !== t.collectionGroup && (t1 += "|cg:" + t.collectionGroup), t1 += "|f:", t1 += t.filters.map((t)=>t.field.canonicalString() + t.op.toString() + xt(t.value)).join(","), t1 += "|ob:", t1 += t.orderBy.map((t)=>t.field.canonicalString() + t.dir).join(","), At(t.limit) || (t1 += "|l:", t1 += t.limit), t.startAt && (t1 += "|lb:", t1 += ce(t.startAt)), t.endAt && (t1 += "|ub:", t1 += ce(t.endAt)), t.A = t1;
}
return t.A;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,9 @@ function(global, factory) {
getParsingFlags(config).invalidFormat = !0, config._d = new Date(NaN);
return;
}
for(i = 0; i < config._f.length; i++)currentScore = 0, validFormatFound = !1, tempConfig = copyConfig({}, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), isValid(tempConfig) && (validFormatFound = !0), //or tokens
currentScore += getParsingFlags(tempConfig).charsLeftOver + 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, bestFormatIsValid ? currentScore < scoreToBeat && (scoreToBeat = currentScore, bestMoment = tempConfig) : (null == scoreToBeat || currentScore < scoreToBeat || validFormatFound) && (scoreToBeat = currentScore, bestMoment = tempConfig, validFormatFound && (bestFormatIsValid = !0));
for(i = 0; i < config._f.length; i++)currentScore = 0, validFormatFound = !1, tempConfig = copyConfig({}, config), null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], configFromStringAndFormat(tempConfig), isValid(tempConfig) && (validFormatFound = !0), // if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver, //or tokens
currentScore += 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, bestFormatIsValid ? currentScore < scoreToBeat && (scoreToBeat = currentScore, bestMoment = tempConfig) : (null == scoreToBeat || currentScore < scoreToBeat || validFormatFound) && (scoreToBeat = currentScore, bestMoment = tempConfig, validFormatFound && (bestFormatIsValid = !0));
extend(config, bestMoment || tempConfig);
}(config) : format ? configFromStringAndFormat(config) : isUndefined(input = config._i) ? config._d = new Date(hooks.now()) : isDate(input) ? config._d = new Date(input.valueOf()) : "string" == typeof input ? // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
function(config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19377,7 +19377,8 @@
dts: buffer[0].dts
}; i < tagSize;)tag.data.set(buffer[0].data.subarray(0, tagSize - i), i), i += buffer[0].data.byteLength, bufferSize -= buffer[0].data.byteLength, buffer.shift();
// find the start of the first frame and the end of the tag
frameStart = 10, 0x40 & tag.data[5] && (frameStart += 4 + parseSyncSafeInteger$1(tag.data.subarray(10, 14)), tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20)));
frameStart = 10, 0x40 & tag.data[5] && (// advance the frame start past the extended header
frameStart += 4, frameStart += parseSyncSafeInteger$1(tag.data.subarray(10, 14)), tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20)));
// http://id3.org/id3v2.3.0#ID3v2_frame_overview
do {
if (// determine the number of bytes in this frame
Expand All @@ -19395,7 +19396,7 @@
var d = frame.data, size = (0x01 & d[3]) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;
size *= 4, size += 0x03 & d[7], frame.timeStamp = size, void 0 === tag.pts && void 0 === tag.dts && (tag.pts = frame.timeStamp, tag.dts = frame.timeStamp), this.trigger("timestamp", frame);
}
tag.frames.push(frame), frameStart += 10 + frameSize;
tag.frames.push(frame), frameStart += 10, frameStart += frameSize;
}while (frameStart < tagSize)
this.trigger("data", tag);
} // collect the entire frame so it can be parsed
Expand Down Expand Up @@ -20125,7 +20126,8 @@
},
parseAacTimestamp: function(packet) {
var frameStart, frameSize, frame; // find the start of the first frame and the end of the tag
frameStart = 10, 0x40 & packet[5] && (frameStart += 4 + parseSyncSafeInteger(packet.subarray(10, 14)));
frameStart = 10, 0x40 & packet[5] && (// advance the frame start past the extended header
frameStart += 4, frameStart += parseSyncSafeInteger(packet.subarray(10, 14)));
// http://id3.org/id3v2.3.0#ID3v2_frame_overview
do {
if (// determine the number of bytes in this frame
Expand All @@ -20140,7 +20142,7 @@
break;
}
}
frameStart += 10 + frameSize; // advance past the frame body
frameStart += 10, frameStart += frameSize;
}while (frameStart < packet.byteLength)
return null;
}
Expand Down Expand Up @@ -20567,7 +20569,8 @@
var transmuxer_Transmuxer = _Transmuxer, bin_toUnsigned = function(value) {
return value >>> 0;
}, parseType_1 = function(buffer) {
return "" + (String.fromCharCode(buffer[0]) + String.fromCharCode(buffer[1]) + String.fromCharCode(buffer[2]) + String.fromCharCode(buffer[3]));
var result = "";
return result += String.fromCharCode(buffer[0]), result += String.fromCharCode(buffer[1]), result += String.fromCharCode(buffer[2]), result += String.fromCharCode(buffer[3]);
}, findBox_1 = function findBox(data, path) {
var i, size, type, end, subresults, results = [];
if (!path.length) // short-circuit the search for empty paths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16540,7 +16540,7 @@
i += "".concat(t[0], " and ").concat(t[1], " arguments");
break;
default:
i += t.slice(0, o - 1).join(", ") + ", and ".concat(t[o - 1], " arguments");
i += t.slice(0, o - 1).join(", "), i += ", and ".concat(t[o - 1], " arguments");
}
return "".concat(i, " must be specified");
}, TypeError), e.exports.codes = l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23267,7 +23267,7 @@
}, Toolbar.prototype.itemWidthCal = function(items) {
var style, _this = this, width = 0;
return [].slice.call((0, ej2_base /* selectAll */ .td)('.' + CLS_ITEM, items)).forEach(function(el) {
(0, ej2_base /* isVisible */ .pn)(el) && (style = window.getComputedStyle(el), width += (_this.isVertical ? el.offsetHeight : el.offsetWidth) + parseFloat(_this.isVertical ? style.marginTop : style.marginRight) + parseFloat(_this.isVertical ? style.marginBottom : style.marginLeft));
(0, ej2_base /* isVisible */ .pn)(el) && (style = window.getComputedStyle(el), width += _this.isVertical ? el.offsetHeight : el.offsetWidth, width += parseFloat(_this.isVertical ? style.marginTop : style.marginRight), width += parseFloat(_this.isVertical ? style.marginBottom : style.marginLeft));
}), width;
}, Toolbar.prototype.getScrollCntEle = function(innerItem) {
var trgClass = this.isVertical ? '.e-vscroll-content' : '.e-hscroll-content';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22544,7 +22544,7 @@
let i = 0;
for(; i < maximumValuesToStringify - 1; i++){
const tmp = stringifyFnReplacer(i, value, stack, replacer, spacer, indentation);
res += (void 0 !== tmp ? tmp : 'null') + join;
res += void 0 !== tmp ? tmp : 'null', res += join;
}
const tmp = stringifyFnReplacer(i, value, stack, replacer, spacer, indentation);
if (res += void 0 !== tmp ? tmp : 'null', value.length - 1 > maximumBreadth) {
Expand Down Expand Up @@ -22597,7 +22597,7 @@
let i = 0;
for(; i < maximumValuesToStringify - 1; i++){
const tmp = stringifyArrayReplacer(i, value[i], stack, replacer, spacer, indentation);
res += (void 0 !== tmp ? tmp : 'null') + join;
res += void 0 !== tmp ? tmp : 'null', res += join;
}
const tmp = stringifyArrayReplacer(i, value[i], stack, replacer, spacer, indentation);
if (res += void 0 !== tmp ? tmp : 'null', value.length - 1 > maximumBreadth) {
Expand Down Expand Up @@ -22648,7 +22648,7 @@
let i = 0;
for(; i < maximumValuesToStringify - 1; i++){
const tmp = stringifyIndent(i, value[i], stack, spacer, indentation);
res += (void 0 !== tmp ? tmp : 'null') + join;
res += void 0 !== tmp ? tmp : 'null', res += join;
}
const tmp = stringifyIndent(i, value[i], stack, spacer, indentation);
if (res += void 0 !== tmp ? tmp : 'null', value.length - 1 > maximumBreadth) {
Expand Down Expand Up @@ -22705,7 +22705,7 @@
let i = 0;
for(; i < maximumValuesToStringify - 1; i++){
const tmp = stringifySimple(i, value[i], stack);
res += (void 0 !== tmp ? tmp : 'null') + ',';
res += void 0 !== tmp ? tmp : 'null', res += ',';
}
const tmp = stringifySimple(i, value[i], stack);
if (res += void 0 !== tmp ? tmp : 'null', value.length - 1 > maximumBreadth) {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class Demo {
bitField += B.encode(curValue);
range.push(i);
ranges.push(range);
}), retrString += '.' + C.encode(ranges);
}), retrString += '.', retrString += C.encode(ranges);
}
}
console.log(Deno.encode());
Original file line number Diff line number Diff line change
Expand Up @@ -8601,7 +8601,7 @@
var styleValue = styles[styleName];
if (null != styleValue) {
var isCustomProperty = 0 === styleName.indexOf("--");
serialized += delimiter + (isCustomProperty ? styleName : styleName.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-")) + ":" + dangerousStyleValue(styleName, styleValue, isCustomProperty), delimiter = ";";
serialized += delimiter + (isCustomProperty ? styleName : styleName.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-")) + ":", serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty), delimiter = ";";
}
}
return serialized || null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
var a = 100, b = 10;
(b = a) ? (a++, b += a + a) : b ^= a;
(b = a) ? (a++, b += a, b += a) : b ^= a;
console.log(a, b);

0 comments on commit 4d31b74

Please sign in to comment.