From 22ec030c1cef2f2a9090201bf5c2b394b4932d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 7 Nov 2022 12:27:43 -0500 Subject: [PATCH] update error message --- .../rhs-not-object/exec.js | 48 +++++++++---------- .../private-loose/rhs-not-object/exec.js | 48 +++++++++---------- .../fixtures/private/rhs-not-object/exec.js | 48 +++++++++---------- .../to-native-fields/rhs-not-object/exec.js | 48 +++++++++---------- 4 files changed, 96 insertions(+), 96 deletions(-) diff --git a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/assumption-privateFieldsAsProperties/rhs-not-object/exec.js b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/assumption-privateFieldsAsProperties/rhs-not-object/exec.js index 412b37f1946d..1065753a6b36 100644 --- a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/assumption-privateFieldsAsProperties/rhs-not-object/exec.js +++ b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/assumption-privateFieldsAsProperties/rhs-not-object/exec.js @@ -1,27 +1,27 @@ -expect(() => class { static #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p() {}; static q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p() {}; static q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p() {}; q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p() {}; q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p() {}; q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p() {}; q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p() {}; q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); diff --git a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private-loose/rhs-not-object/exec.js b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private-loose/rhs-not-object/exec.js index 412b37f1946d..1065753a6b36 100644 --- a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private-loose/rhs-not-object/exec.js +++ b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private-loose/rhs-not-object/exec.js @@ -1,27 +1,27 @@ -expect(() => class { static #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p() {}; static q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p() {}; static q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p() {}; q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p() {}; q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p() {}; q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p() {}; q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p() {}; q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); diff --git a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private/rhs-not-object/exec.js b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private/rhs-not-object/exec.js index 412b37f1946d..1065753a6b36 100644 --- a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private/rhs-not-object/exec.js +++ b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/private/rhs-not-object/exec.js @@ -1,27 +1,27 @@ -expect(() => class { static #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p() {}; static q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p() {}; static q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p() {}; q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p() {}; q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p() {}; q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p() {}; q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p() {}; q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); diff --git a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/to-native-fields/rhs-not-object/exec.js b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/to-native-fields/rhs-not-object/exec.js index 412b37f1946d..1065753a6b36 100644 --- a/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/to-native-fields/rhs-not-object/exec.js +++ b/packages/babel-plugin-proposal-private-property-in-object/test/fixtures/to-native-fields/rhs-not-object/exec.js @@ -1,27 +1,27 @@ -expect(() => class { static #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => class { static #p() {}; static q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => class { static #p() {}; static q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => class { static #p() {}; static q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => class { static #p() {}; static q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'"); -expect(() => new class { #p() {}; q = #p in 0 }).toThrowError(`right-hand side of 'in' should be an object, got number`); -expect(() => new class { #p() {}; q = #p in "" }).toThrowError(`right-hand side of 'in' should be an object, got string`); -expect(() => new class { #p() {}; q = #p in true }).toThrowError(`right-hand side of 'in' should be an object, got boolean`); -expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError(`right-hand side of 'in' should be an object, got undefined`); -expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError(`right-hand side of 'in' should be an object, got symbol`); -expect(() => new class { #p() {}; q = #p in 0n }).toThrowError(`right-hand side of 'in' should be an object, got bigint`); +expect(() => new class { #p() {}; q = #p in 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in "" }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in true }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in void 0 }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in Symbol.iterator }).toThrowError("Cannot use 'in' operator to search for '0'"); +expect(() => new class { #p() {}; q = #p in 0n }).toThrowError("Cannot use 'in' operator to search for '0'");