--- source: crates/biome_formatter_test/src/snapshot_builder.rs info: js/babel-plugins/v8intrinsic.js --- # Input ```js // https://github.com/babel/babel/pull/10148 %DebugPrint(foo); // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json // ::%DebugPrint(null) // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json // a.%DebugPrint(); // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json // const i = %DebugPrint; // i(foo); // https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json // %DebugPrint?.(null) new %DebugPrint(null); function *foo() { yield %StringParseInt("42", 10) } foo%bar() ``` # Prettier differences ```diff --- Prettier +++ Biome @@ -1,6 +1,6 @@ // https://github.com/babel/babel/pull/10148 -%DebugPrint(foo); +%DebugPrint(foo) // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json // ::%DebugPrint(null) @@ -18,7 +18,8 @@ new %DebugPrint(null); function* foo() { - yield %StringParseInt("42", 10); + yield; + %StringParseInt("42", 10) } foo % bar(); ``` # Output ```js // https://github.com/babel/babel/pull/10148 %DebugPrint(foo) // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json // ::%DebugPrint(null) // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json // a.%DebugPrint(); // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json // const i = %DebugPrint; // i(foo); // https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json // %DebugPrint?.(null) new %DebugPrint(null); function* foo() { yield; %StringParseInt("42", 10) } foo % bar(); ``` # Errors ``` v8intrinsic.js:3:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a statement but instead found '%DebugPrint(foo)'. 1 │ // https://github.com/babel/babel/pull/10148 2 │ > 3 │ %DebugPrint(foo); │ ^^^^^^^^^^^^^^^^ 4 │ i Expected a statement here. 1 │ // https://github.com/babel/babel/pull/10148 2 │ > 3 │ %DebugPrint(foo); │ ^^^^^^^^^^^^^^^^ 4 │ v8intrinsic.js:19:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression but instead found '%'. 17 │ // %DebugPrint?.(null) 18 │ > 19 │ new %DebugPrint(null); │ ^ 20 │ 21 │ function *foo() { i Expected an expression here. 17 │ // %DebugPrint?.(null) 18 │ > 19 │ new %DebugPrint(null); │ ^ 20 │ 21 │ function *foo() { v8intrinsic.js:22:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none 21 │ function *foo() { > 22 │ yield %StringParseInt("42", 10) │ ^ 23 │ } 24 │ i An explicit or implicit semicolon is expected here... 21 │ function *foo() { > 22 │ yield %StringParseInt("42", 10) │ ^ 23 │ } 24 │ i ...Which is required to end this statement 21 │ function *foo() { > 22 │ yield %StringParseInt("42", 10) │ ^^^^^^^ 23 │ } 24 │ ``` # Lines exceeding max width of 80 characters ``` 5: // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json 8: // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json 11: // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json 15: // https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json ```