borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

[JS] Dynamic object methods #129

Closed Whoaa512 closed 6 years ago

Whoaa512 commented 6 years ago

image

screenshot 2018-04-11 15 17 54

sample code

const TRACK = 'track'
const FIX = 'fix'

export default function foo(api, { version }) {
    return {
        [TRACK](someArg) {},
        [FIX]({ someArg2 }) {},
        foobar(thisWorks, { nope }) {
            return nope
        },
        bar: (thisWorks, { yup }) => {
            return 'yas'
        },
        baz: (thisWorks, { yup }) => {
            return 'yas'
        },
    }
}
borela commented 6 years ago

Fixed https://github.com/borela/naomi/releases/tag/v3.15.8