Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error for function call to await() #5564

Closed
jlagerblad opened this issue Mar 13, 2016 · 5 comments · Fixed by #5581
Closed

Parse error for function call to await() #5564

jlagerblad opened this issue Mar 13, 2016 · 5 comments · Fixed by #5581
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Comments

@jlagerblad
Copy link

What version of ESLint are you using?
2.4.0 and 2.2.0
What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

{
    "extends": "eslint:recommended",

    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },

    "parserOptions": {
        "sourceType": "module"
    },

    "globals": {
        "$": false,
        "cs": false,
        "DEBUG": false,
        "LOG_DEBUG": false,
        "LOG_INFO": false,
        "LOG_WARN": false,
        "LOG_ERROR": false,
        "TIMING": false
    },

    "ecmaFeatures": {
        "modules": true
    },

    "rules": {
        "eol-last": [2],
        "global-strict": [0],
        "key-spacing": [0],
        "new-cap": [0],
        "no-alert": [0],
        "no-console": [2],
        "no-sequences": [0],
        "no-trailing-spaces": [2],
        "no-underscore-dangle": [0],
        "no-unused-vars": [2, { "args": "none" }],
        "no-use-before-define": [2, "nofunc"],
        "quotes": [0, "single", "avoid-escape"]
    }
}

What did you do? Please include the actual source code causing the issue.
I ran: eslint -f unix ./src
On a file with this content, there is a parse error (It used to work with eslint 1.x)

/**
 *
 */

var queue = globals.queue;

export default function(){
    queue().await();
}

What did you expect to happen?

What actually happened? Please include the actual, raw output from ESLint.
/Users/jonas/work/csd-js-modules/data-layer/src/api/test.js:8:13: Parsing error: Unexpected token await [Error]

2 problems

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Mar 13, 2016
@faceleg
Copy link

faceleg commented Mar 14, 2016

Confirmed using setup described above: https://gist.github.com/faceleg/29f16af0b146a59d6b99

@faceleg faceleg added bug ESLint is working incorrectly accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Mar 14, 2016
@BYK BYK added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed accepted There is consensus among the team that this change meets the criteria for inclusion labels Mar 14, 2016
@BYK
Copy link
Member

BYK commented Mar 14, 2016

await is a reserved word so I'm not sure if this is actually a bug.

@BYK
Copy link
Member

BYK commented Mar 14, 2016

@nzakas, @michaelficarra - the following code works in my Node REPL (both in normal and strict modes) so I think this is a bug with Espree.

var a = {await: console.log.bind(console)}
a.await()
a.await("lalala")

@michaelficarra
Copy link
Member

Yep.

@mysticatea mysticatea added accepted There is consensus among the team that this change meets the criteria for inclusion blocked This change can't be completed until another issue is resolved and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Mar 14, 2016
@mysticatea mysticatea added core Relates to ESLint's core APIs and features and removed blocked This change can't be completed until another issue is resolved labels Mar 14, 2016
@mysticatea
Copy link
Member

espree v3.1.2 released. 😄

@mysticatea mysticatea self-assigned this Mar 15, 2016
nzakas added a commit that referenced this issue Mar 15, 2016
Fix: Ensure allowing `await` as a property name (fixes #5564)
pvamshi pushed a commit to pvamshi/eslint that referenced this issue Mar 17, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants