Skip to content

Commit

Permalink
fix: oxc_define
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY committed Dec 4, 2024
1 parent e787e9d commit a0bcfb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ impl<'a> ReplaceGlobalDefines<'a> {
};
}

true
current_part_member_expression.is_none()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@ fn dot() {
test("process['env'].NODE_ENV", "production", config.clone());
}

#[ignore]
#[test]
fn dot_with_overlap() {
let config = ReplaceGlobalDefinesConfig::new(&[
("import.meta.env.FOO", "import.meta.env.FOO"),
("import.meta.env", "__foo__"),
("__OBJ__", r#"{"process":{"env":{"SOMEVAR":"foo"}}}"#),
("process.env.SOMEVAR", "\"foo\""),
])
.unwrap();
test("import.meta.env", "__foo__", config.clone());
test("import.meta.env.NODE_ENV", "import.meta.env.NODE_ENV", config.clone());
test("console.log(__OBJ__.process.env.SOMEVAR)", "__foo__", config.clone());
// test("import.meta.env.FOO", "import.meta.env.FOO", config.clone());
}

#[test]
Expand Down

0 comments on commit a0bcfb9

Please sign in to comment.