diff options
author | 2021-08-11 21:46:23 -0700 | |
---|---|---|
committer | 2021-08-11 21:46:23 -0700 | |
commit | 160f83cf9e73cbc4c342238c1ca45884a9316ef8 (patch) | |
tree | 3cc1e0988ac0941b53fab9b4d10887edf99f4139 /src/js_parser/js_parser.zig | |
parent | 3e0a78bc0d94989a46314b09109d2a8eedf1e032 (diff) | |
download | bun-160f83cf9e73cbc4c342238c1ca45884a9316ef8.tar.gz bun-160f83cf9e73cbc4c342238c1ca45884a9316ef8.tar.zst bun-160f83cf9e73cbc4c342238c1ca45884a9316ef8.zip |
When there are errors while generating the .jsb, fail the build.
Former-commit-id: 734f021602ac59aeaef9d7583a927ede94ab644a
Diffstat (limited to 'src/js_parser/js_parser.zig')
-rw-r--r-- | src/js_parser/js_parser.zig | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/js_parser/js_parser.zig b/src/js_parser/js_parser.zig index 9801e7e32..8b9649aa2 100644 --- a/src/js_parser/js_parser.zig +++ b/src/js_parser/js_parser.zig @@ -10315,11 +10315,14 @@ pub fn NewParser( e_.must_keep_due_to_with_stmt = result.is_inside_with_scope; e_.ref = result.ref; + // TODO: fix the underyling cause here + // The problem seems to be that result.ref.inner_index is not always set. + // Handle assigning to a constant - if (in.assign_target != .none and p.symbols.items[result.ref.inner_index].kind == .cconst) { - const r = js_lexer.rangeOfIdentifier(p.source, expr.loc); - p.log.addRangeErrorFmt(p.source, r, p.allocator, "Cannot assign to {s} because it is a constant", .{name}) catch unreachable; - } + // if (in.assign_target != .none and p.symbols.items[result.ref.inner_index].kind == .cconst) { + // const r = js_lexer.rangeOfIdentifier(p.source, expr.loc); + // p.log.addRangeErrorFmt(p.source, r, p.allocator, "Cannot assign to {s} because it is a constant", .{name}) catch unreachable; + // } var original_name: ?string = null; |