question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

a bug about parseFilter

See original GitHub issue

try eslint to reproduce the bug.


<template>
  <div>{{ 1 | identity() || 0 }}</div>
</template>

<script>
export default {};
</script>

This is because identity() || 0 is LogicalExpression but not CallExpression.

This is the bug code.


//  `parseFilter` in `./src/script/index.ts`

if (argsCode != null) {
    const { ast } = parseScriptFragment(
        `0${argsCode}`,
        locationCalculator.getSubCalculatorAfter(paren - 1),
        parserOptions,
    )
    const statement = ast.body[0] as ESLintExpressionStatement
    const callExpression = statement.expression as ESLintCallExpression

    ast.tokens!.shift()
    
    // this is LogicalExpression
    for (const argument of callExpression.arguments) {
        argument.parent = expression
        expression.arguments.push(argument)
    }
    
    // ...
}

im not good at parser, and I dont know how to fix this bug. So i only create an issue but not a pr.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yyx990803commented, Dec 29, 2018

I think this should be a syntax error.

0reactions
mysticateacommented, Dec 31, 2018

@yyx990803 Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

a bug about parseFilter · Issue #37 · vuejs/vue-eslint-parser · GitHub
This is because identity() || 0 is LogicalExpression but not CallExpression . This is the bug code. // `parseFilter` in `./src/script/index.ts` if (argsCode...
Read more >
Bug #16738 :: Problem parsing filter - PHP
Description: ------------ Hello, I want to parse filter string with Net_LDAP2_Filter :: parse() : My filter is ...
Read more >
scim2-parse-filter vulnerabilities | Snyk
Learn more about known vulnerabilities in the scim2-parse-filter package. ... version 0.2.0 with bug correction.
Read more >
1943386 – knockd: pcap: can't parse filter expression
Bug 1943386 - knockd: pcap: can't parse filter expression: syntax error. Summary: knockd: pcap: can't parse filter expression: syntax error ...
Read more >
[Libreoffice-bugs] [Bug 113974] Ability to parse/filter JSON data and ...
[Libreoffice-bugs] [Bug 113974] Ability to parse/filter JSON data and extract fields · bugzilla-daemon Mon, 29 Nov 2021 05:48:40 -0800.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found