--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/v8_intrinsic/intrinsic_call.js --- # Input ```js function doSmth() { %DebugPrint ( foo ) } function printFunc ( f ) { if(% IsAsmWasmCode(f)) console.log("asm.js"); if( % IsWasmCode( f)) console.log ( "wasm" ); console.log (% GetFunctioName(f) ); } ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -1,10 +1,22 @@ function doSmth() { - %DebugPrint(foo); + %DebugPrint + ( + foo ) } function printFunc(f) { - if (%IsAsmWasmCode(f)) console.log("asm.js"); - if (%IsWasmCode(f)) console.log("wasm"); + if(% + IsAsmWasmCode(f)) console.log("asm.js"); + if( + + % IsWasmCode( + f)) + console.log ( + "wasm" + ); - console.log(%GetFunctioName(f)); + console.log + (% + GetFunctioName(f) + ); } ``` # Output ```js function doSmth() { %DebugPrint ( foo ) } function printFunc(f) { if(% IsAsmWasmCode(f)) console.log("asm.js"); if( % IsWasmCode( f)) console.log ( "wasm" ); console.log (% GetFunctioName(f) ); } ``` # Errors ``` intrinsic_call.js:2:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected a statement but instead found '%DebugPrint ( foo )' 1 │ function doSmth() { > 2 │ %DebugPrint │ ^^^^^^^^^^^ > 3 │ ( > 4 │ foo ) │ ^^^^^ 5 │ } 6 │ i Expected a statement here 1 │ function doSmth() { > 2 │ %DebugPrint │ ^^^^^^^^^^^ > 3 │ ( > 4 │ foo ) │ ^^^^^ 5 │ } 6 │ intrinsic_call.js:10:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression for the left hand side of the `%` operator. 8 │ f 9 │ ) { > 10 │ if(% │ ^ 11 │ IsAsmWasmCode(f)) console.log("asm.js"); 12 │ if( i This operator requires a left hand side value intrinsic_call.js:14:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression for the left hand side of the `%` operator. 12 │ if( 13 │ > 14 │ % IsWasmCode( │ ^ 15 │ f)) 16 │ console.log ( i This operator requires a left hand side value intrinsic_call.js:21:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression for the left hand side of the `%` operator. 20 │ console.log > 21 │ (% │ ^ 22 │ GetFunctioName(f) 23 │ ); i This operator requires a left hand side value ```