aboutsummaryrefslogtreecommitdiff
path: root/src/js_ast.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r--src/js_ast.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig
index 6be187beb..35ff0ea95 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -327,7 +327,7 @@ pub const AssignTarget = enum(u2) {
}
};
-pub const LocRef = struct { loc: logger.Loc, ref: ?Ref };
+pub const LocRef = struct { loc: logger.Loc, ref: ?Ref = null };
pub const Flags = struct {
pub const JSXElement = struct {
@@ -901,19 +901,19 @@ pub const Symbol = struct {
symbols_for_source: [][]Symbol,
pub fn get(self: *Map, ref: Ref) ?*Symbol {
- if (Ref.isSourceIndexNull(ref.source_index) or ref.is_source_contents_slice) {
+ if (Ref.isSourceIndexNull(ref.sourceIndex()) or ref.isSourceContentsSlice()) {
return null;
}
- return &self.symbols_for_source[ref.source_index][ref.inner_index];
+ return &self.symbols_for_source[ref.sourceIndex()][ref.innerIndex()];
}
pub fn getConst(self: *Map, ref: Ref) ?*const Symbol {
- if (Ref.isSourceIndexNull(ref.source_index) or ref.is_source_contents_slice) {
+ if (Ref.isSourceIndexNull(ref.sourceIndex()) or ref.isSourceContentsSlice()) {
return null;
}
- return &self.symbols_for_source[ref.source_index][ref.inner_index];
+ return &self.symbols_for_source[ref.sourceIndex()][ref.innerIndex()];
}
pub fn init(sourceCount: usize, allocator: std.mem.Allocator) !Map {
@@ -7977,7 +7977,7 @@ pub const Macro = struct {
// test "Binding.init" {
// var binding = Binding.alloc(
// std.heap.page_allocator,
-// B.Identifier{ .ref = Ref{ .source_index = 0, .inner_index = 10 } },
+// B.Identifier{ .ref = Ref{ .source_index = 0, .innerIndex() = 10 } },
// logger.Loc{ .start = 1 },
// );
// std.testing.expect(binding.loc.start == 1);