Skip to content

Commit

Permalink
Regenerate expected Babel outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg committed Sep 9, 2024
1 parent 5adfb86 commit f36df6f
Show file tree
Hide file tree
Showing 68 changed files with 121 additions and 749 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const localDev = getMode().localDev;
const minified = getMode().minified;
const development = getMode().development;
const namespaceVersion = mode.version();

function getMode() {
return {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const test = false;
const localDev = false;
const minified = true;
const development = getMode().development;

function foo() {
if (getMode().development == false) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const localDev = false;
const minified = true;
const development = false;
const namespaceVersion = "$internalRuntimeVersion$";

function foo() {
if (false == false) {
return false;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ let baz = NaN;
let yep = 'hello';
let another = {};
let array = [];

function thing() {
let foo = true;
let bar = 1;
Expand All @@ -13,7 +12,6 @@ function thing() {
let another = {};
let array = [];
}

thing: {
let foo = true;
let bar = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var baz = NaN;
var yep = 'hello';
var another = {};
var array = [];

function thing() {
var foo = true;
var bar = 1;
Expand All @@ -13,7 +12,6 @@ function thing() {
var another = {};
var array = [];
}

thing: {
var foo = true;
var bar = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ let baz = NaN;
let yep = 'hello';
let another = {};
let array = [];

function thing() {
let foo = true;
let bar = 1;
Expand All @@ -13,7 +12,6 @@ function thing() {
let another = {};
let array = [];
}

thing: {
let foo = true;
let bar = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
const pure = v => v;

const ignored = pure(foo() || new Bar() || pure(pure(foo('bar', bar(), new Baz())) || 'foo'));
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
// Import does not end with core/dom/jsx so we ignore this file.

/** @jsx Preact.createElement */
import * as Preact from 'preact';

() => Preact.createElement("svg", null);

() => Preact.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg"
});

() => Preact.createElement("path", {
foo: "bar"
});

() => Preact.createElement("circle", {
foo: "bar"
});

() => Preact.createElement("div", null);

() => Preact.createElement("span", {
class: "whatever"
});
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
/** @jsx jsx.createElement */
import * as jsx from '../ANYWHERE_THAT_LEADS_TO/core/dom/jsx';

() => jsx.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg"
});

() => jsx.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg"
});

() => jsx.createElement("path", {
foo: "bar",
xmlns: "http://www.w3.org/2000/svg"
});

() => jsx.createElement("circle", {
foo: "bar",
xmlns: "http://www.w3.org/2000/svg"
});

() => jsx.createElement("div", null);

() => jsx.createElement("span", {
class: "whatever"
});
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";

const _foo = foo,
a = _foo.a,
b = _foo.b,
c = _objectWithoutPropertiesLoose(_foo, ["a", "b"]);

a = _foo.a,
b = _foo.b,
c = _objectWithoutPropertiesLoose(_foo, ["a", "b"]);
const _bar = bar,
d = _bar.d,
e = _bar.e,
f = _objectWithoutPropertiesLoose(_bar, ["d", "e"]);

d = _bar.d,
e = _bar.e,
f = _objectWithoutPropertiesLoose(_bar, ["d", "e"]);
const g = _objectSpread({}, foo);

const h = _objectSpread({
bar
}, bar);
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ import { jsxStylePropertyString as _jsxStylePropertyString3 } from "#core/dom/js
import { jsxStylePropertyString as _jsxStylePropertyString2 } from "#core/dom/jsx/style-property-string";
import { jsxStylePropertyString as _jsxStylePropertyString } from "#core/dom/jsx/style-property-string";
import * as jsx from 'ANYWHERE_LEADING_TO/core/dom/jsx';

const dimensional = () => <div style={"width:100px;" + _jsxStylePropertyString("height", height, true)} />;

const nonDimensional = () => <div>
<div style={_jsxStylePropertyString2("animation-iteration-count", animationIterationCount)} />
<div style={"animation-iteration-count:5;"} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import * as jsx from 'ANYWHERE_LEADING_TO/core/dom/jsx';

const logicalAnd = () => <div style={x && "background:red;"} />;

const logicalAndDeep = () => <div style={x && foo && "color:red;"} />;

const logicalOr = () => <div style={x || "background:red;"} />;

const ternary = () => <div style={x ? "color:red;" : "background:red;"} />;

const ternaryNested = () => <div style={x ? y ? "color:red;" : null : "background:red;"} />;
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
import { jsxStylePropertyString as _jsxStylePropertyString2 } from "#core/dom/jsx/style-property-string";
import { jsxStylePropertyString as _jsxStylePropertyString } from "#core/dom/jsx/style-property-string";
import * as jsx from 'ANYWHERE_LEADING_TO/core/dom/jsx';

const randomObjectExpressionsAreUnmodified = () => ({
background,
color: null
});

const nonObjectExpressionsAreUnmodified = () => <div>
<div style={foo} />
<div style={foo ? 'foo: bar;' : null} />
</div>;

const red = 'red';

const otherAttributesAreUnmodified = () => <div foo={{
color: null,
'background-color': red,
backgroundImage,
opacity: 0,
width: 100
}} />;

const modified = () => <div style={"background-color:red;" + _jsxStylePropertyString("background-image", backgroundImage, true) + "opacity:0;" + "width:100px;"} />;

const emptyStringValueIsRemoved = () => <div style={""} />;

let dynamic = 0;

function modifyDynamicValue() {
dynamic = 1;
}

let backgroundColor = 'blue';

const constants = () => <div style={"background-color:blue;" + "width:100px;" + "color:white;" + _jsxStylePropertyString2("opacity", dynamic)} />;

const empty = () => <div style={""} />;
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@ const x = {
foo: 'bar',
bar: 'qux',
[x]: 'y'
}; // not mangled:
};

// not mangled:
const y = notMangled({
foo: 'bar',
bar: 'qux',
[x]: 'y'
}); // mangled:
});

// mangled:
const z = {
foo: 1,
bar: 2,
[x]: 3
}; // dupes:
};

// dupes:
const a = {
foo: 1,
baz: 2,
// should be same as foo:
bar: 1
}; // 100 elements:
};

// 100 elements:
const b = {
k0: 1,
k1: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
defineCallback.apply(null, arguments);
var name = "build-system/babel-plugins/babel-plugin-nomodule-loader/test/fixtures/transform/export-default/input";
var awaiting = callbacks[name] = callbacks[name] || [];

while (awaiting.length) {
awaiting.pop()(_exports);
}

awaiting.push = function (callback) {
callback(_exports);
};
} : defineCallback;

if (true) {
exec({});
} else if (null) {
Expand All @@ -24,7 +21,6 @@
if (true && name === 0) {
return {};
}

return new Promise(function (resolve) {
(callbacks[name] = callbacks[name] || []).push(resolve);
});
Expand All @@ -37,6 +33,5 @@

_exports.__esModule = true;
_exports.default = fn;

function fn() {}
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
defineCallback.apply(null, arguments);
var name = "build-system/babel-plugins/babel-plugin-nomodule-loader/test/fixtures/transform/export-from/input";
var awaiting = callbacks[name] = callbacks[name] || [];

while (awaiting.length) {
awaiting.pop()(_exports);
}

awaiting.push = function (callback) {
callback(_exports);
};
} : defineCallback;

if (false) {
exec({});
} else if (null) {
Expand All @@ -24,7 +21,6 @@
if (true && name === 0) {
return {};
}

return new Promise(function (resolve) {
(callbacks[name] = callbacks[name] || []).push(resolve);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
defineCallback.apply(null, arguments);
var name = "build-system/babel-plugins/babel-plugin-nomodule-loader/test/fixtures/transform/import-default/input";
var awaiting = callbacks[name] = callbacks[name] || [];

while (awaiting.length) {
awaiting.pop()(_exports);
}

awaiting.push = function (callback) {
callback(_exports);
};
} : defineCallback;

if (false) {
exec({});
} else if ("build-system/babel-plugins/babel-plugin-nomodule-loader/test/fixtures/transform/import-default/x") {
Expand All @@ -24,7 +21,6 @@
if (false && name === 0) {
return {};
}

return new Promise(function (resolve) {
(callbacks[name] = callbacks[name] || []).push(resolve);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
defineCallback.apply(null, arguments);
var name = "build-system/babel-plugins/babel-plugin-nomodule-loader/test/fixtures/transform/imports-and-exports/input";
var awaiting = callbacks[name] = callbacks[name] || [];

while (awaiting.length) {
awaiting.pop()(_exports);
}

awaiting.push = function (callback) {
callback(_exports);
};
} : defineCallback;

if (false) {
exec({});
} else if (null) {
Expand All @@ -24,7 +21,6 @@
if (true && name === 0) {
return {};
}

return new Promise(function (resolve) {
(callbacks[name] = callbacks[name] || []).push(resolve);
});
Expand All @@ -37,10 +33,9 @@

_exports.__esModule = true;
_exports.baz = void 0;
const baz = {
const baz = _exports.baz = {
foo: _foo.foo,
bar: _foo.bar,
baz: 'baz'
};
_exports.baz = baz;
});
Loading

0 comments on commit f36df6f

Please sign in to comment.