Skip to content

JS class privacy tag syntax error injected upon file save #129787

@dshipp25

Description

@dshipp25

Issue Type: Bug

When the file is saved, the class private Hash tag is separated from it's identifier, introducing a syntax error. This code demonstrates:

class testthis {
  #privateProperty;
    constructor() {
        this.#privateProperty = 0;
    }
    #privateMethod() {
        return this.#privateProperty;
    }
};

Upon saving the file, it becomes

class testthis {
    #
    privateProperty;

    constructor() {
        this.#privateProperty = 0;
    }

    #
    privateMethod() {
        return this.#privateProperty;
    }
}; which causes an error during code interpretation - identified missing after #.

VS Code version: Code 1.58.2 (c3f1263, 2021-07-14T22:10:15.214Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.65GB (8.02GB free)
Process Argv --crash-reporter-id 9d98c34d-dc9e-4de9-96e9-e012074fac71
Screen Reader no
VM 0%
Extensions: none (all disabled to retest error...)

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions