mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
parent
002289b4b1
commit
ce25c450fc
1 changed files with 4 additions and 3 deletions
|
|
@ -134,10 +134,10 @@ impl<'a> DisableDirectivesBuilder<'a> {
|
||||||
// `eslint-disable-line`
|
// `eslint-disable-line`
|
||||||
else if let Some(text) = text.strip_prefix("-line") {
|
else if let Some(text) = text.strip_prefix("-line") {
|
||||||
// Get the span between the preceding newline to this comment
|
// Get the span between the preceding newline to this comment
|
||||||
let start = source_text[..=comment.span.start as usize]
|
let start = source_text[..comment.span.start as usize]
|
||||||
.lines()
|
.lines()
|
||||||
.next_back()
|
.next_back()
|
||||||
.map_or(0, |line| comment.span.start - (line.len() as u32 - 1));
|
.map_or(0, |line| comment.span.start - line.len() as u32);
|
||||||
let stop = comment.span.start;
|
let stop = comment.span.start;
|
||||||
|
|
||||||
// `eslint-disable-line`
|
// `eslint-disable-line`
|
||||||
|
|
@ -430,7 +430,8 @@ fn test() {
|
||||||
format!("
|
format!("
|
||||||
/* {prefix}-disable , ,no-debugger, , */
|
/* {prefix}-disable , ,no-debugger, , */
|
||||||
debugger;
|
debugger;
|
||||||
")
|
"),
|
||||||
|
format!("debugger;//
{prefix}-disable-line")
|
||||||
];
|
];
|
||||||
|
|
||||||
let fail = vec![
|
let fail = vec![
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue