aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-24 09:36:34 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-24 09:36:34 -0700
commitec66b1819a2fd218c62c069d29aab7eed482f6e9 (patch)
tree81381b1aa464e81b118bf64951b58cd21eedf83e /src
parent0a18da2d05a7c17fc63aa05b5db9bdcc3e303be8 (diff)
downloadbun-ec66b1819a2fd218c62c069d29aab7eed482f6e9.tar.gz
bun-ec66b1819a2fd218c62c069d29aab7eed482f6e9.tar.zst
bun-ec66b1819a2fd218c62c069d29aab7eed482f6e9.zip
WIP
Diffstat (limited to 'src')
-rw-r--r--src/js_parser.zig18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 03988d0f1..e7692c76f 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -13,6 +13,7 @@ usingnamespace js_ast.G;
const ImportKind = importRecord.ImportKind;
const BindingNodeIndex = js_ast.BindingNodeIndex;
+
const StmtNodeIndex = js_ast.StmtNodeIndex;
const ExprNodeIndex = js_ast.ExprNodeIndex;
const ExprNodeList = js_ast.ExprNodeList;
@@ -997,14 +998,15 @@ const P = struct {
std.debug.panic("Internal error", .{});
}
- // for name, member := range scope.parent.members {
- // // Don't copy down the optional function expression name. Re-declaring
- // // the name of a function expression is allowed.
- // kind := p.symbols[member.Ref.InnerIndex].Kind
- // if kind != js_ast.SymbolHoistedFunction {
- // scope.Members[name] = member
- // }
- // }
+ var iter = scope.parent.?.members.iterator();
+ while (iter.next()) |entry| {
+ // // Don't copy down the optional function expression name. Re-declaring
+ // // the name of a function expression is allowed.
+ const adjacent_symbols = p.symbols.items[entry.value.ref.inner_index];
+ if (adjacent_symbols.kind != .hoisted_function) {
+ try scope.members.put(entry.key, entry.value);
+ }
+ }
}
return i;