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

- bugfix - Fix optional dynamic-property/function not recognized. #469

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.6.28"
"version": "2024.11.1"
}, undefined, 4)
}
].map(async function ({
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- 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.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
- coverage - Fix coverage-function v8CoverageReportCreate() throwing error EINVAL in latest nodejs-security-patch, when running win32-coverage with npm.cmd.
- jslint - Remove unnecessary shell-function shCurlExe().
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
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.6.28";
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
4 changes: 2 additions & 2 deletions jslint_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1457,8 +1457,8 @@ import moduleUrl from "url";
}
// replace trailing "/" with "/index.html"
file = pathname.slice(1).replace((
/\/$/
), "/index.html");
/\/$|^$/m
), "./index.html");
// resolve file
file = modulePath.resolve(file);
// security - disable parent-directory lookup
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.6.28"
"version": "2024.11.1-beta"
}