Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Wrong highlight for a property name #334

Open
@KSXGitHub

Description

@KSXGitHub

I just updated the lastest version of language-javascript (v0.112.0) which has the following bugs. I don't know which old version I used but it hasn't these bugs. Also, I think property names should be highlighted (in JSON objects and ES6 classes), it would be a good way to avoid these bugs.

I can use a keyword as a property name in JavaScript, but language-javascript matchs it wrong

image

test1 = {
    normal: "It's okay",
    function: "'function' is just a property name, and it's valid, please don't highlight this 'function' here"
}

image

class test2 {
    normal() {/* It's okay */}
    function() {/* Again, this 'function' is just a property name, not a keyword */}
}

image

test3 = {
    normal() {/* It's okay */},
    function() {/* This 'function' is a property name, not a keyword */}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions