aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-17 14:37:37 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-17 14:37:37 -0800
commit609222d05e92811cc68b3aa73f78d66562243161 (patch)
treecf1d0c41341ba53f1c26420275c699649f023c6f /src
parent5d91922c5d6bf58f7073aa1081dee69d9a050cee (diff)
downloadbun-609222d05e92811cc68b3aa73f78d66562243161.tar.gz
bun-609222d05e92811cc68b3aa73f78d66562243161.tar.zst
bun-609222d05e92811cc68b3aa73f78d66562243161.zip
Fixes https://github.com/oven-sh/bun/issues/1624
This was disabled anyway
Diffstat (limited to 'src')
-rw-r--r--src/js_parser.zig42
1 files changed, 1 insertions, 41 deletions
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 992f4fe32..43ec76262 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -5135,10 +5135,6 @@ fn NewParser_(
switch (comptime jsx_transform_type) {
.react => {
- if (p.options.jsx.development) {
- p.jsx_filename = p.declareGeneratedSymbol(.other, "jsxFilename") catch unreachable;
- }
-
if (p.options.features.jsx_optimization_inline) {
p.react_element_type = p.declareGeneratedSymbol(.other, "REACT_ELEMENT_TYPE") catch unreachable;
p.es6_symbol_global = p.declareGeneratedSymbol(.unbound, "Symbol") catch unreachable;
@@ -13459,7 +13455,6 @@ fn NewParser_(
// Either:
// jsxDEV(type, arguments, key, isStaticChildren, source, self)
// jsx(type, arguments, key)
- const include_filename = FeatureFlags.include_filename_in_jsx and p.options.jsx.development;
const args = p.allocator.alloc(Expr, if (p.options.jsx.development) @as(usize, 6) else @as(usize, 2) + @as(usize, @boolToInt(e_.key != null))) catch unreachable;
args[0] = tag;
@@ -13492,42 +13487,7 @@ fn NewParser_(
},
};
- if (include_filename) {
- var source = p.allocator.alloc(G.Property, 2) catch unreachable;
- p.recordUsage(p.jsx_filename.ref);
- source[0] = G.Property{
- .key = Expr{ .loc = expr.loc, .data = Prefill.Data.Filename },
- .value = p.e(E.Identifier{
- .ref = p.jsx_filename.ref,
- .can_be_removed_if_unused = true,
- }, expr.loc),
- };
-
- source[1] = G.Property{
- .key = Expr{ .loc = expr.loc, .data = Prefill.Data.LineNumber },
- .value = p.e(E.Number{ .value = @intToFloat(f64, expr.loc.start) }, expr.loc),
- };
-
- // Officially, they ask for columnNumber. But I don't see any usages of it in the code!
- // source[2] = G.Property{
- // .key = Expr{ .loc = expr.loc, .data = Prefill.Data.ColumnNumber },
- // .value = p.e(E.Number{ .value = @intToFloat(f64, expr.loc.start) }, expr.loc),
- // };
- args[4] = p.e(E.Object{
- .properties = G.Property.List.init(source),
- }, expr.loc);
-
- // When disabled, this must specifically be undefined
- // Not an empty object
- // See this code from react:
- // > if (source !== undefined) {
- // > var fileName = source.fileName.replace(/^.*[\\\/]/, "");
- // > var lineNumber = source.lineNumber;
- // > return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
- // > }
- } else {
- args[4] = p.e(E.Undefined{}, expr.loc);
- }
+ args[4] = p.e(E.Undefined{}, expr.loc);
args[5] = Expr{ .data = Prefill.Data.This, .loc = expr.loc };
}