mirror of
https://github.com/swc-project/swc.git
synced 2024-10-05 04:39:06 +03:00
fix(css/parser): Fix infinite loop about @import
and layer
(#5919)
This commit is contained in:
parent
ce6b0886d1
commit
10cdbed05e
@ -1868,6 +1868,8 @@ where
|
||||
let start = self.input.cur_span().lo;
|
||||
let mut name = vec![];
|
||||
|
||||
let entered = is!(self, Ident);
|
||||
|
||||
while is!(self, Ident) {
|
||||
let span = self.input.cur_span();
|
||||
let token = bump!(self);
|
||||
@ -1889,6 +1891,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
if !entered {
|
||||
// if first argument is not ident, without bump! will cause infinite loop
|
||||
bump!(self);
|
||||
}
|
||||
|
||||
Ok(LayerName {
|
||||
name,
|
||||
span: span!(self, start),
|
||||
|
Loading…
Reference in New Issue
Block a user