Skip to content

Commit 81e25ad

Browse files
committed
fix: html entity escape
1 parent c956663 commit 81e25ad

18 files changed

Lines changed: 1176 additions & 96 deletions

File tree

crates/oxc_angular_compiler/src/component/definition.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,9 +2167,8 @@ mod tests {
21672167

21682168
#[test]
21692169
fn test_dependencies_runtime_resolved_with_array_imports() {
2170-
// Test that array literals inside function call args get trailing commas
2171-
// Angular outputs: ɵɵgetComponentDepsFactory(Comp,[A,B,C,])
2172-
// NOT: ɵɵgetComponentDepsFactory(Comp,[A,B,C])
2170+
// Test that array literals inside function call args are emitted correctly
2171+
// Angular outputs: ɵɵgetComponentDepsFactory(Comp,[A,B,C])
21732172
let allocator = Allocator::default();
21742173
let mut metadata = create_test_metadata(&allocator);
21752174
let mut namespace_registry = NamespaceRegistry::new(&allocator);

crates/oxc_angular_compiler/src/directive/compiler.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ mod tests {
10251025
let emitter = JsEmitter::new();
10261026
let output = result.map(|e| emitter.emit_expression(&e)).unwrap_or_default();
10271027

1028-
// Expected: {value:"value",} - simple string format (emitter uses trailing comma)
1028+
// Expected: {value:"value"} - simple string format
10291029
assert!(output.contains(r#"value:"value""#), "Simple input should be string: {}", output);
10301030
// Should NOT contain array brackets for simple case
10311031
assert!(!output.contains("["), "Simple input should not be array: {}", output);
@@ -1219,7 +1219,8 @@ mod tests {
12191219
);
12201220

12211221
// Transform input: [2, "boolInput", "boolInput", booleanAttribute]
1222-
// Note: The emitter may add newlines in the output, so we check for key parts
1222+
// Note: The emitter may add newlines in the output for multi-line arrays,
1223+
// so we check for key parts
12231224
assert!(
12241225
output.contains(r#"boolInput:[2,"boolInput","boolInput","#)
12251226
&& output.contains("booleanAttribute]"),

crates/oxc_angular_compiler/src/directive/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ mod tests {
10511051
"Signal query should have ctx.refQuery as target.\nGot:\n{}",
10521052
output
10531053
);
1054-
// Note: The emitter may include trailing comma in arrays: ["myRef",]
1054+
// Note: The emitter formats arrays without trailing commas: ["myRef"]
10551055
assert!(
10561056
output.contains(r#"["myRef""#),
10571057
"Signal query should have string selector array as predicate.\nGot:\n{}",

0 commit comments

Comments
 (0)