--- source: crates/biome_formatter_test/src/snapshot_builder.rs info: js/babel-plugins/function-bind.js --- # Input ```js // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind obj::func // is equivalent to: func.bind(obj) ::obj.func // is equivalent to: obj.func.bind(obj) obj::func(val) // is equivalent to: func.call(obj, val) ::obj.func(val) // is equivalent to: obj.func.call(obj, val) ``` # Prettier differences ```diff --- Prettier +++ Biome @@ -1,16 +1,18 @@ // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind -obj::func; +obj: +:func // is equivalent to: -func.bind(obj)::obj.func; +func.bind(obj) + +::obj.func // is equivalent to: -obj.func.bind(obj); +obj.func.bind(obj) -obj::func(val); +obj::func(val) // is equivalent to: -func - .call(obj, val) +func.call(obj, val) - ::obj.func(val); +::obj.func(val) // is equivalent to: -obj.func.call(obj, val); +obj.func.call(obj, val) ``` # Output ```js // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind obj: :func // is equivalent to: func.bind(obj) ::obj.func // is equivalent to: obj.func.bind(obj) obj::func(val) // is equivalent to: func.call(obj, val) ::obj.func(val) // is equivalent to: obj.func.call(obj, val) ``` # Errors ``` function-bind.js:3:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a statement but instead found ':'. 1 │ // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind 2 │ > 3 │ obj::func │ ^ 4 │ // is equivalent to: 5 │ func.bind(obj) i Expected a statement here. 1 │ // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind 2 │ > 3 │ obj::func │ ^ 4 │ // is equivalent to: 5 │ func.bind(obj) ```