Skip to content

Commit

Permalink
- bugfix - Fix optional dynamic-property/function-call not recognized.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhu256 committed Nov 11, 2024
1 parent eff91e7 commit ed25389
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ import moduleFs from "fs";
"type": "git",
"url": "https://github.com/jslint-org/jslint.git"
},
"version": "2024.10.1"
"version": "2024.11.1"
}, undefined, 4)
}
].map(async function ({
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
- jslint - add new warning requiring paren around plus-separated concatenations.
- jslint - try to improve parser to be able to parse jquery.js without stopping.

# v2024.10.1
# v2024.11.1-beta
- bugfix - Fix optional dynamic-property/function-call not recognized.
- ci - Update shell-function shHttpFileServer() to auto-serve /index.html, when url-path is root /.

# v2024.6.28
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Douglas Crockford <[email protected]>


# Status
| Branch | [master<br>(v2024.10.1)](https://github.com/jslint-org/jslint/tree/master) | [beta<br>(Web Demo)](https://github.com/jslint-org/jslint/tree/beta) | [alpha<br>(Development)](https://github.com/jslint-org/jslint/tree/alpha) |
| Branch | [master<br>(v2024.6.28)](https://github.com/jslint-org/jslint/tree/master) | [beta<br>(Web Demo)](https://github.com/jslint-org/jslint/tree/beta) | [alpha<br>(Development)](https://github.com/jslint-org/jslint/tree/alpha) |
|--:|:--:|:--:|:--:|
| CI | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jslint-org/jslint/actions?query=branch%3Amaster) | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=beta)](https://github.com/jslint-org/jslint/actions?query=branch%3Abeta) | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=alpha)](https://github.com/jslint-org/jslint/actions?query=branch%3Aalpha) |
| Coverage | [![coverage](https://jslint-org.github.io/jslint/branch-master/.artifact/coverage/coverage_badge.svg)](https://jslint-org.github.io/jslint/branch-master/.artifact/coverage/index.html) | [![coverage](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage/coverage_badge.svg)](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage/index.html) | [![coverage](https://jslint-org.github.io/jslint/branch-alpha/.artifact/coverage/coverage_badge.svg)](https://jslint-org.github.io/jslint/branch-alpha/.artifact/coverage/index.html) |
Expand Down Expand Up @@ -923,7 +923,7 @@ eval("1"); //jslint-ignore-line
- `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.6.23
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.11.9
- click `Create pull request`
- input `Add your description here...` with:
```
Expand All @@ -932,7 +932,7 @@ Fixes #xxx.
This PR will ...
this PR will additionally:
This PR will additionally:
- <secondary-commit-message>
...
Expand Down
17 changes: 14 additions & 3 deletions jslint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ let jslint_charset_ascii = (
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
);
let jslint_edition = "v2024.10.1";
let jslint_edition = "v2024.11.1-beta";
let jslint_export; // The jslint object to be exported.
let jslint_fudge = 1; // Fudge starting line and starting
// ... column to 1.
Expand Down Expand Up @@ -4698,8 +4698,7 @@ function jslint_phase3_parse(state) {

function infix_option_chain(left) {
const the_token = token_now;
let name;
name = token_nxt;
let name = token_nxt;
if (
(
left.id !== "(string)"
Expand Down Expand Up @@ -4733,6 +4732,18 @@ function jslint_phase3_parse(state) {

check_left(left, the_token);
}

// Issue #468 - Fix optional dynamic-property/function-call not recognized.

if (name.id === "[" || name.id === "(") {
test_cause("dyn_prop_or_call");

// test_cause:
// ["aa?.(bb)", "infix_option_chain", "dyn_prop_or_call", "", 0]
// ["aa?.[bb]", "infix_option_chain", "dyn_prop_or_call", "", 0]

return left;
}
if (!name.identifier) {

// test_cause:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"shCiArtifactUpload": 1,
"shCiPublishNpm": 1,
"type": "module",
"version": "2024.10.1"
"version": "2024.11.1-beta"
}

0 comments on commit ed25389

Please sign in to comment.