Skip to content

Commit 79a75af

Browse files
committed
focus on flags for now
1 parent 59d9164 commit 79a75af

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

core/parser/src/lexer/cursor.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ impl<R: ReadChar> Cursor<R> {
179179
} else if let Some(byte) = self.next_char()? {
180180
buf[count] = byte as u8;
181181
count += 1;
182+
} else if count >= buf.len() {
183+
return Err(Error::new(
184+
ErrorKind::UnexpectedEof,
185+
"Unexpected end of buffer while taking characters",
186+
));
182187
} else {
183188
// next_is_pred will return false if the next value is None so the None case should already be handled.
184189
unreachable!();

core/parser/src/parser/expression/assignment/mod.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ use crate::{
2929
Error,
3030
};
3131
use boa_ast::{
32-
expression::{
33-
operator::assign::{Assign, AssignOp, AssignTarget},
34-
RegExpLiteral,
35-
},
32+
expression::operator::assign::{Assign, AssignOp, AssignTarget},
3633
operations::{bound_names, contains, lexically_declared_names, ContainsSymbol},
3734
Expression, Keyword, Punctuator, Span,
3835
};
@@ -150,13 +147,6 @@ where
150147
.into());
151148
}
152149
}
153-
TokenKind::RegularExpressionLiteral(body, flags) => {
154-
let node =
155-
RegExpLiteral::new(*body, *flags, cursor.peek(0, interner).or_abrupt()?.span())
156-
.into();
157-
cursor.advance(interner);
158-
return Ok(node);
159-
}
160150
_ => {}
161151
}
162152

0 commit comments

Comments
 (0)