diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/es_private_fields.js | 15 | ||||
-rw-r--r-- | cli/tests/es_private_fields.js.out | 1 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 5 |
3 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/es_private_fields.js b/cli/tests/es_private_fields.js new file mode 100644 index 000000000..b5f83e39c --- /dev/null +++ b/cli/tests/es_private_fields.js @@ -0,0 +1,15 @@ +class Foo { + #field = "field"; + + setValue(val) { + this.#field = val; + } + + getValue() { + return this.#field; + } +} + +const bar = new Foo(); +bar.setValue("PRIVATE"); +console.log(bar.getValue()); diff --git a/cli/tests/es_private_fields.js.out b/cli/tests/es_private_fields.js.out new file mode 100644 index 000000000..be1970b05 --- /dev/null +++ b/cli/tests/es_private_fields.js.out @@ -0,0 +1 @@ +PRIVATE diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 0a50190d2..6ab204082 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1827,6 +1827,11 @@ itest!(fix_js_imports { output: "fix_js_imports.ts.out", }); +itest!(es_private_fields { + args: "run --quiet --reload es_private_fields.js", + output: "es_private_fields.js.out", +}); + itest!(proto_exploit { args: "run proto_exploit.js", output: "proto_exploit.js.out", |