Skip to content

JSDefender throws parsing error for public fields? #48

@LRagji

Description

@LRagji

Not sure if this is the correct repo to raise this defect, but stuck on it for sometime
I have example.js file

export class Server {
    props = "abc"
}

Then i run

jsdefender --license ./example.js ./exampleO.js --estarget es2020

Which gives me parsing error as below

PreEmptive Protection JSDefender(TM)
Copyright 2019-2024 PreEmptive Solutions, LLC. All Rights Reserved
Use of this software constitutes acceptance of the accompanying license agreement.
Info: JSDefender version 2.7.0
Info: Licensed to: 
Floating Build License:
This software may be used on binaries for general release.Concurrent Build Limit: 8
Info: JSDefender is up to date.
Info: Source tree building in progress...
Error: Parse error found in 1 source code script.
Execution time: 1s 867ms

Now i understand that my JS file is with correct definition of ES specs: MDN then what is this parse errors...

The same error pops up for private fields as well # preceded.

Following code works:

export class Server {
    constructor()
    {
        this.props = "abc";
    }
}

What am i doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions