profile
viewpoint

briangonzalez/jquery.pep.js 1320

👟 Pep, a lightweight plugin for kinetic drag on mobile/desktop

incompl/cloak 344

A network layer for HTML5 games using Node.js

fb55/css-select 248

a CSS selector compiler & engine

fb55/domhandler 190

Handler for htmlparser2, to get a DOM

bterlson/eshost 107

A uniform wrapper around a multitude of ECMAScript hosts. CLI: https://github.com/bterlson/eshost-cli

fb55/domutils 106

Utilities for working with htmlparser2's DOM

jsdevel/webdriver-sync 106

Synchronous testing with Selenium and node.js!

bterlson/test262-harness 55

Experimental harness for test262

iros/d3.chart.horizontal-legend 15

A d3.chart based horizontal legend that takes a d3 color scale and returns a legend

jugglinmike/ariadriver 5

A Node.js library for testing web applications using WebDriver and ARIA

pull request commentjshint/jshint

Correct reporting of early "param" references

The number of expected failures this eliminates is astonishing.

Yeah. Test262's test generation tool can make for some pretty satisfying fixes.

@jugglinmike can you resolve the conflicts? Thanks!

All set!

jugglinmike

comment created time in 4 days

push eventjugglinmike/jshint

Mike Pennisi

commit sha 354a73f0970fc5de49a5e3d071b12f9413c1f65f

[[DOCS]] Correct description of internal function

view details

Mike Pennisi

commit sha e353176479c982a6814af1c4ca797053ca540a3e

[[CHORE]] Remove unreachable code No call site for `propertyName` specifies an object value for the second argument. The `optionalidentifier` function returns only string values or undefined. These two invariants make the untested code paths unreachable. Remove them both.

view details

Mike Pennisi

commit sha 61e37d3a0d14c2ebacdcd11d55330b55396c1f72

[[DOCS]] Document internal function

view details

Mike Pennisi

commit sha 85466ac1530f7109774daae681cc9488d0b77294

[[CHORE]] Improve name of internal variable

view details

Mike Pennisi

commit sha a6691c5c83eccc0ee5fa1bbed17394b7cd5b3ac1

[[CHORE]] Simplify internal function

view details

Mike Pennisi

commit sha 575f46502144d18fbe41bc0a802d903ba3c3a3ab

[[CHORE]] Simplify internal function In so-called "object short notation," an IdentifierName is interpreted as both a LiteralPropertyName and an IdentifierReference. The second is a more restrictive goal than the first, so it is not necessary to apply the LiteralPropertyName validation rules. Removing that validation logic allows for an otherwise-unused parameter of the internal `propertyName` function to be removed.

view details

Mike Pennisi

commit sha ff192f68ef236f5ab2e7306d5cdd02032e1cf1a3

[[FIX]] Correct interpretation of ImportSpecifier

view details

Mike Pennisi

commit sha 4c7ddf5ac398da98050028229746ae38e714eaf4

[[FIX]] Consider all exported bindings "used" Extend consideration to include bindings created using DestructuringBindingPattern.

view details

Mike Pennisi

commit sha f0cfeedcfd907b6a2baa36a87571a0cc65f06fbb

[[CHORE]] Remove unnecessary branch Currently, the `setExported` method only makes the specified binding as "used." This is unnecessary in this context because when `expression` processes an IdentifierReference, it does the same. Remove the branch.

view details

Mike Pennisi

commit sha 9c7cb47c42f952557bffef7fd692898d0510e0d4

[[FIX]] Detect duplicate exported bindings

view details

Mike Pennisi

commit sha 2fdd31739a114e78e83902aef41a58f147284ce0

[[FIX]] Correct location for error

view details

Mike Pennisi

commit sha 861cea3660542756c0f9bfa385906191f3fbcc38

[[FIX]] Report early reference with warning The situation described by this condition does not constitute syntactically invalid code, so it should be reported with a warning.

view details

push time in 4 days

push eventjshint/jshint

Nguyen Long Nhat

commit sha 890f6c9d562394e30961833ecaf93516fa3a6b8d

[[DOCS]] Add vscode jshint (#3508) * Add vscode-jshint * h3 => h4

view details

push time in 5 days

PR merged jshint/jshint

Add vscode jshint Docs Issue

I added VS Code JSHint extension in install.md.

+3 -0

2 comments

1 changed file

torn4dom4n

pr closed time in 5 days

PullRequestReviewEvent

pull request commentjshint/jshint

Fixes markdown syntax

Please do. The website build system will not produce the intended markup from a file which uses that syntax.

torn4dom4n

comment created time in 5 days

PR opened jshint/jshint

Reviewers
[[FIX]] Improve declaration parsing

Add an internal test so the coverage analysis tool recognizes that the modified branch is verified.

+22 -8

0 comment

3 changed files

pr created time in 5 days

push eventjugglinmike/jshint

Mike Pennisi

commit sha 0d9f6fd4cd539a588f01d06cf6b082192a6be446

[[CHORE]] Recognize 'esversion: 11' This commit extends the options parsing system to tolerate the values "11" and "2020" for the `esversion` linting option. It does not introduce support for any features introduced by the new edition of the language.

view details

Mike Pennisi

commit sha f5b097102776661e64286bfb18732d1512d1e832

[[FIX]] Graduate BigInt support to `esversion: 11`

view details

Mike Pennisi

commit sha 12c16d34e1b5b7ade12fcdad4ab0021c0b22c2cf

[[FIX]] Improve declaration parsing Add an internal test so the coverage analysis tool recognizes that the modified branch is verified.

view details

push time in 5 days

create barnchjugglinmike/jshint

branch : invoke-declaration

created branch time in 5 days

pull request commentjshint/jshint.github.io

Update docs.md with updated example according to current defaults

Thanks for following up on this! It's always nice to get a hand :)

I chose a new example and tried to make the purpose and workings of the two kinds of boolean options more clear.

Sounds like a good idea to me

As I understand it, looking at the options.js at https://github.com/jshint/jshint/blob/master/src/options.js , the current default options have curly: true and notypeof: true. if that's not the case, please correct me.

Not quite. Both "enforcing" and "relaxing" options are disabled by default. The values used in the source code aren't related to JSHint's enforcement.

If you input your example code without any configuration, JSHint will report:

line 1, col 15, Invalid typeof value 'fuction' (W122)

If you want to suppress that warning, you'd have to configure JSHint to be less strict by enabling the "relaxing" option, notypeof.

If you want to receive a warning about the absense of curly braces, you'd have to configure JSHint to be more strict by enabling the "enforcing" option, curly.

svArtist

comment created time in 5 days

issue commentjshint/jshint

Docs page: Example code wrong?

Thanks for the report! That example is incorrect in more ways than one. As of gh-3109, JSHint no longer reports the referenced warning, ever. To resolve this, we'll need to demonstrate "relaxing" options with a different example.

Want to try fixing this, @svArtist?

Note that the documentation in question currently resides in the project website repository.

svArtist

comment created time in 12 days

issue closedjshint/jshint.github.io

docs/options/ points to JSCS which itself is deprecated

For some JSHint-deprecated options for style checking, the "JSHint Options" page points to JSCS at https://github.com/jscs-dev/node-jscs. That repository says it is archived, read-only, unmaintained, and mentions it is merged with ESLint. Probably makes sense to update the link.

closed time in 19 days

xmjl

issue commentjshint/jshint.github.io

docs/options/ points to JSCS which itself is deprecated

I'm not aware of an alternative style checker, but if anyone has a suggestion, we'll certainly consider a patch!

xmjl

comment created time in 19 days

issue commentjshint/jshint

how to use esversion 6 in vue project

There isn't enough information here for anyone to help you. The project's contribution guidelines have some suggestions for filing an actionable support request; we can re-open this issue once there's more information.

googlemarketer

comment created time in 19 days

pull request commentAirtable/airtable.js

Fix github lint warnings

Thanks, Z! I have a few more questions

How is that task configured? Is it possible to run it locally? Do the results truly differ from the results of npm run lint?

When I review the change set for this patch on GitHub.com, I see "Check warning" annotations. Is this patch intended to address those?

mzgoddard

comment created time in 24 days

issue openedAirtable/airtable.js

Regression in build status reporting

When we first enabled continuous integration for this project, the system reported linting warnings/errors generated from every supported version of Node.js.

In gh-190, we decided that this was generally more noise than signal and limited the reported warnings/errors to only the latest version of Node.js.

Now, it seems that warnings/errors are once again repeated for every supported version of Node.js. Was this intentional?

created time in 25 days

pull request commentAirtable/airtable.js

Fix github lint warnings

@mzgoddard The project's npm run lint command reports several warnings before and after this patch is applied. Where is "github lint" defined?

mzgoddard

comment created time in 25 days

PR opened jshint/jshint

Reviewers
Correct reporting of early "param" references
+25 -142

0 comment

4 changed files

pr created time in 25 days

create barnchjugglinmike/jshint

branch : fix-early-param-reference

created branch time in 25 days

issue closedjshint/jshint

Various Pages Out of Date on JSHint.com

Just a heads up that the domain (JSHint.com) needs a current sync from the Github repo for September/October. Docs, About, Install pages, etc. are missing some updates vs. the source code on the repo.

closed time in 25 days

matt-nelson1

issue commentjshint/jshint

Various Pages Out of Date on JSHint.com

This is controlled in the website repository. Should be good, now.

matt-nelson1

comment created time in 25 days

push eventjshint/jshint.github.io

Mike Pennisi

commit sha e23e2cd5e1b2646d5a7db2af285841c9577888d2

Build site.

view details

push time in 25 days

push eventjshint/jshint.github.io

Mike Pennisi

commit sha 71e7292339393e6440b3fa51e8f80e1418d9f085

Update JSHint submodule for documentation updates

view details

Mike Pennisi

commit sha d98bb3ce8cf7e461b9b36d10c0aafa5786571057

Build site.

view details

push time in 25 days

push eventjshint/jshint.github.io

Mike Pennisi

commit sha 71e7292339393e6440b3fa51e8f80e1418d9f085

Update JSHint submodule for documentation updates

view details

push time in 25 days

push eventjshint/jshint

Nguyen Long Nhat

commit sha e9212339b81fe04758ddce9435a418632ce9c3c2

[[DOCS]] Fix #3505 (#3509)

view details

push time in 25 days

PR merged jshint/jshint

Fix #3505

Fixed #3505 .

+1 -1

2 comments

1 changed file

torn4dom4n

pr closed time in 25 days

issue closedjshint/jshint

Documentation: Options typo for esversion 10

In the page https://jshint.com/docs/options/, there's a typo in the link in the description for esversion bullet point for 10. It's causing the URL to include the trailing ')'. I think it's missing the '[' in front of "ECMAScript 10]".

closed time in 25 days

jp-larose

pull request commentjshint/jshint

Fix #3505

Thanks!

torn4dom4n

comment created time in 25 days

Pull request review commentjshint/jshint

Add vscode jshint

 JSHint). JSLint and JSHint). * [Web Essentials](http://vswebessentials.com) (Runs JSHint automatically). +### Visual Studio Code

This should use a level-4 heading

torn4dom4n

comment created time in 25 days

PullRequestReviewEvent

pull request commentjshint/jshint

Fixes markdown syntax

Thanks for the patch! The "footnote" syntax is not recognized by the project website's Markdown processor, so it won't have the intended effect. Could you remove those changes?

torn4dom4n

comment created time in 25 days

Pull request review commentmozilla/standards-positions

Correct typos

   },   {     "ciuName": null,-    "description": "A descriptor for CSS @page rules that changes the orientation of the page in generated PDF output (or similar) without otherwise affecing layout.",+    "description": "A descriptor for CSS @page rules that changes the orientation of the page in generated PDF output (or similar) without otherwise effecting layout.",

Thanks! (Leave it to me to make a spelling mistake in a patch intended to correct spelling mistakes.) Should be good now.

jugglinmike

comment created time in a month

PullRequestReviewEvent

push eventbocoup/standards-positions

Mike Pennisi

commit sha ce5440cd792f73f1952d19ba963cf44b6f62127f

fixup! Correct typos

view details

push time in a month

PR opened mozilla/standards-positions

Correct typos
+3 -3

0 comment

1 changed file

pr created time in a month

create barnchbocoup/standards-positions

branch : correct-typos

created branch time in a month

issue commentAirtable/airtable.js

Increase dependency granularity to avoid superfluous warnings and reduce package size

Good points, all around. Given the limited scope of the methods in use and the recent introduction of TypeScript, maybe it's best to replace Lodash with TypeScript-provided equivalents where available (and home-grown implementations where not).

$ git grep -Eh 'import.*lodash' src/ | sort | uniq -c | sort -n
      1 import clone from 'lodash/clone';
      1 import get from 'lodash/get';
      1 import isFunction from 'lodash/isFunction';
      1 import isNil from 'lodash/isNil';
      1 import isNumber from 'lodash/isNumber';
      1 import isString from 'lodash/isString';
      1 import keys from 'lodash/keys';
      2 import includes from 'lodash/includes';
      2 import map from 'lodash/map';
      3 import assign from 'lodash/assign';
      3 import isArray from 'lodash/isArray';
      3 import isPlainObject from 'lodash/isPlainObject';
      5 import forEach from 'lodash/forEach';
jugglinmike

comment created time in a month

PR opened Airtable/airtable.js

Apply machine-generated changes to manifest files

The npm command-line utility ensures that package.json and package-lock.json include a trailing newline following routine operations such as npm install.

+2 -2

0 comment

2 changed files

pr created time in a month

create barnchbocoup/airtable.js

branch : manifest-formatting

created branch time in a month

issue commentwebsocket-client/websocket-client

Legitimacy of license change

I wouldn't assume the support of non-respondents--contributions like that really ought to be re-written.

Here's another example http://mikepennisi.com/blog/2020/you-may-finally-use-jshint-for-evil/

jugglinmike

comment created time in a month

push eventjshint/jshint

brca1255

commit sha 91ce80302d1942ad28a153f7cf57c3d6b8abb9b4

[[DOCS]] Add JSHint user We've used JSHint extensively on Find My Electric for checking the JavaScript in our image gallery, lightbox, VIN validator, and many, many other places. Would love to help show our support for the project! Cheers.

view details

push time in a month

PR merged jshint/jshint

Update README.md

We've used JSHint extensively on Find My Electric for checking the JavaScript in our image gallery, lightbox, VIN validator, and many, many other places. Would love to help show our support for the project! Cheers.

+1 -0

2 comments

1 changed file

brca1255

pr closed time in a month

PR closed jshint/jshint

Security Fix for Remote Code Execution - huntr.dev

https://huntr.dev/users/alromh87 has fixed the Remote Code Execution vulnerability 🔨. alromh87 has been awarded $25 for fixing the vulnerability through the huntr bug bounty program 💵. Think you could fix a vulnerability like this?

Get involved at https://huntr.dev/

Q | A Version Affected | ALL Bug Fix | YES Original Pull Request | https://github.com/418sec/jshint/pull/4 Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/jshint/1/README.md

User Comments:

Bounty URL: https://www.huntr.dev/bounties/1-npm-jshint/

⚙️ Description *

jshint was vulnerable against arbitrary command injection cause some user supplied inputs were taken and composed into string to be executed without prior validation. After update Arbitary Code Execution is avoided

💻 Technical Description *

Shelljs was used to execute command that use piping functions this has been replaced with safer spawn and conecting stdout to stdin

🐛 Proof of Concept (PoC) *

  1. Install the package
  2. Create poc file
// poc.js
var jshint = require("jshint/bin/apply");
  1. Check there aren't files called HACKED
  2. Execute the following commands:
node poc.js 'https://eee.w.www.ww"; touch HACKED; #' #  Run the PoC ... you'll need to CTRL+C after
  1. It will create a file HACKED in the working directory.

Captura de pantalla de 2020-09-09 13-13-39

🔥 Proof of Fix (PoF) *

After fix no file is created

Captura de pantalla de 2020-09-12 02-13-13

👍 User Acceptance Testing (UAT)

Functionality unafected

Captura de pantalla de 2020-09-12 02-42-40

+32 -2

1 comment

1 changed file

huntr-helper

pr closed time in a month

pull request commentjshint/jshint

Security Fix for Remote Code Execution - huntr.dev

Thanks for the patch! We don't use that script, so it's probably best to just remove it altogether.

huntr-helper

comment created time in a month

push eventjshint/jshint

Mike Pennisi

commit sha a5745d5bd070708bdc1128cc140537b9ffc0518b

[[CHORE]] Remove unused maintenance script

view details

push time in a month

push eventjugglinmike/jshint

Mike Pennisi

commit sha 62f448f5f6be7cd7ccca554a87039001d9617ca4

[[FIX]] Detect duplicate exported bindings

view details

push time in a month

PR opened jshint/jshint

Reviewers
Improve handling of exported bindings

It might not look like it, but this is in support of ES2020's new production, export default as ns from ''; (tracking via gh-3486).

+218 -82

0 comment

6 changed files

pr created time in a month

push eventjugglinmike/jshint

Mike Pennisi

commit sha 10daf79b999084c350147d695e6748d048b13b23

[[FIX]] Consider all exported bindings "used" Extend consideration to include bindings created using DestructuringBindingPattern.

view details

Mike Pennisi

commit sha 737524d1b72600eb3d47463cb03645fe262b40d5

[[CHORE]] Remove unnecessary branch Currently, the `setExported` method only makes the specified binding as "used." This is unnecessary in this context because when `expression` processes an IdentifierReference, it does the same. Remove the branch.

view details

Mike Pennisi

commit sha 6fa4464a7493e96707da444c0ea54a2074fc26df

[[FIX]] Detect duplicate exported bindings

view details

push time in a month

create barnchjugglinmike/jshint

branch : export-use-destructuring-bindings

created branch time in a month

create barnchjugglinmike/jshint

branch : duplicate-exports

created branch time in a month

push eventjugglinmike/jshint

Mike Pennisi

commit sha 411dcb0a55b6c9ff0a9adc72e095efecc6627b55

[[CHORE]] Improve name of internal variable

view details

Mike Pennisi

commit sha ca59769a5bc121eb0f29e089ce5b0e2472db5142

[[CHORE]] Simplify internal function

view details

Mike Pennisi

commit sha 3f6f61c908f5e1b74adc4a58eb694aad4debb24b

[[CHORE]] Simplify internal function In so-called "object short notation," an IdentifierName is interpreted as both a LiteralPropertyName and an IdentifierReference. The second is a more restrictive goal than the first, so it is not necessary to apply the LiteralPropertyName validation rules. Removing that validation logic allows for an otherwise-unused parameter of the internal `propertyName` function to be removed.

view details

Mike Pennisi

commit sha ea5fbb3fd3169db7e1dd55b63bb5ea6f31f1ecad

[[FIX]] Correct interpretation of ImportSpecifier

view details

push time in a month

push eventjugglinmike/jshint

Mike Pennisi

commit sha f5b097102776661e64286bfb18732d1512d1e832

[[FIX]] Graduate BigInt support to `esversion: 11`

view details

Mike Pennisi

commit sha d07ad3198d65069e3cc0c9afaa17c3d30b04492a

[[DOCS]] Correct description of internal function

view details

Mike Pennisi

commit sha ec3009e2df4ac8ad85449b671a14030b5e504e0d

[[CHORE]] Remove unreachable code No call site for `propertyName` specifies an object value for the second argument. The `optionalidentifier` function returns only string values or undefined. These two invariants make the untested code paths unreachable. Remove them both.

view details

Mike Pennisi

commit sha 3f7cb7235eb35697331583c94ff748b048f6609b

[[DOCS]] Document internal function

view details

Mike Pennisi

commit sha af6f3a1409c4b6c502635601f8152ba794595ee6

[[CHORE]] Improve name of internal variable

view details

Mike Pennisi

commit sha 2f1965a194aff5890510f68150cc16817ce93e11

[[CHORE]] Simplify internal function

view details

Mike Pennisi

commit sha ef47fc81558e81c40c933699ed526105cc1af3eb

[[CHORE]] Simplify internal function In so-called "object short notation," an IdentifierName is interpreted as both a LiteralPropertyName and an IdentifierReference. The second is a more restrictive goal than the first, so it is not necessary to apply the LiteralPropertyName validation rules. Removing that validation logic allows for an otherwise-unused parameter of the internal `propertyName` function to be removed.

view details

push time in a month

push eventjshint/jshint

Mike Pennisi

commit sha f5b097102776661e64286bfb18732d1512d1e832

[[FIX]] Graduate BigInt support to `esversion: 11`

view details

push time in a month

push eventjugglinmike/jshint

Alexandre Alapetite

commit sha 17d8f5a6529c01ac7bfc4e6c1b16fb20c2b6427e

[[FIX]] Update Lodash to latest 4.17.19 (#3494) Address vulnerability of type "Prototype Pollution in lodash" https://github.com/advisories/GHSA-p6mc-m468-83gw It is not sure whether this is at all relevant for jshint, but at the moment, GitHub's Dependabot sends vulnerability alerts to all respositories with a dependency to jshint, e.g. https://github.com/alexandrainst/node-red-contrib-parser-ini/network/alert/package-lock.json/lodash/open So it would be nice to issue a new jshint release ASAP to offer an easy way forward for those projects with a (dev) dependency to jshint. https://github.com/lodash/lodash/wiki/Changelog

view details

Mike Pennisi

commit sha b02a025f95f2c7cace8a4db482e2a926d074378f

[[FIX]] Disallow invalid numeric literals

view details

Mike Pennisi

commit sha 3b2c8cfa2836d1e620334b4a7d3a01bf5e3c529e

[[FIX]] Disallow leading zeros in BigInts

view details

Mike Pennisi

commit sha 1806ddb4a6dc1a36bbf8e3b8235953e0501e786c

v2.11.2

view details

Mike Pennisi

commit sha 297f8cea568628611276b8e8d0e6ef47b53afc15

[[CHORE]] Revert "Count ternary and or operators for complexity" JSHint's tracking of cyclomatic complexity within Conditional Expressions and Or Expressions is derived from code first contributed by Tim Ruffles <timruffles@googlemail.com>. That contributor could not be reached to sign JSHint's Contributor License Agreement. Revert their contribution to the application logic (preserving the corresponding MIT-licensed test code) so that it may be re-written under the terms of the Contributor License Agreement. Revert the changes introduced by 87e3e6ccfb3c37417a56946dce5904742bd43311

view details

Matt Surabian

commit sha 7a5948c64b5b3937e422843c0234f7a4685bba68

Evaluate the or symbol to account for complexity increase

view details

Matt Surabian

commit sha 8a205a808582579592d5301bba587894e3a824c8

Increase complexity count when encountering the ternary operator

view details

Mike Pennisi

commit sha e6ad7a2322f1bfdc8d7e41ad3150972772007677

Merge branch 'reimplement-complexity-count'

view details

Mike Pennisi

commit sha c7a7c66128b8eaaa0423e5d600a72fa1742cca59

[[CHORE]] Revert "Add codes to errors generated by quit()" JSHint's emission of the `code` property of errors from the internal `quit` function is derived from code first contributed by Nikolay S. Frantsev <privatbank@frantsev.ru>. That contributor could not be reached to sign JSHint's Contributor License Agreement. Revert their contribution to the application logic (preserving the corresponding MIT-licensed test code) so that it may be re-written under the terms of the Contributor License Agreement. Revert the changes introduced by 537dcbd4be49f5b52ede08e98b23e49bbc5e4bbc

view details

Tyler Kellen

commit sha 94d7f239da4b2ae300b2342af0b777a489f63765

add missing error code context

view details

Mike Pennisi

commit sha a683c100bc024fe3d11d575764a3ddb4b15615e6

Merge branch 'reimplement-quit-code'

view details

Mike Pennisi

commit sha d65513c54ac00188bba3987383bf09ac50c8d463

[[FEAT]] Update project license

view details

Mike Pennisi

commit sha a9dbe4f3559c75a0ead9de26da54bdee0869f5dd

v2.12.0

view details

Mike Pennisi

commit sha 18f977e0eb699badc4463b441bafbe39edba47f1

[[CHORE]] Correct link in change log

view details

Mike Pennisi

commit sha 0d9f6fd4cd539a588f01d06cf6b082192a6be446

[[CHORE]] Recognize 'esversion: 11' This commit extends the options parsing system to tolerate the values "11" and "2020" for the `esversion` linting option. It does not introduce support for any features introduced by the new edition of the language.

view details

Mike Pennisi

commit sha dc00db324b3c5e3bc6bff575df3cd77ac77af67c

[[FIX]] Graduate BigInt support to `esversion: 11`

view details

Mike Pennisi

commit sha a3107eeca1d336b7b7730c96388a2ebf9aa7d678

[[DOCS]] Correct description of internal function

view details

Mike Pennisi

commit sha a80b81acbfae7e824d700195dcab1773ff484de2

[[CHORE]] Remove unreachable code No call site for `propertyName` specifies an object value for the second argument. The `optionalidentifier` function returns only string values or undefined. These two invariants make the untested code paths unreachable. Remove them both.

view details

Mike Pennisi

commit sha 626784342b9c136456b2273fe6e082ded00ce54f

[[DOCS]] Document internal function

view details

Mike Pennisi

commit sha f210ffe46346da03160af4751c17034ed74a9d62

[[CHORE]] Improve name of internal variable

view details

push time in a month

push eventjshint/jshint

Mike Pennisi

commit sha dc00db324b3c5e3bc6bff575df3cd77ac77af67c

[[FIX]] Graduate BigInt support to `esversion: 11`

view details

push time in a month

pull request commentjshint/jshint

Version 2.13.0

Rebased on top of the master branch

jugglinmike

comment created time in a month

push eventjshint/jshint

Alexandre Alapetite

commit sha 17d8f5a6529c01ac7bfc4e6c1b16fb20c2b6427e

[[FIX]] Update Lodash to latest 4.17.19 (#3494) Address vulnerability of type "Prototype Pollution in lodash" https://github.com/advisories/GHSA-p6mc-m468-83gw It is not sure whether this is at all relevant for jshint, but at the moment, GitHub's Dependabot sends vulnerability alerts to all respositories with a dependency to jshint, e.g. https://github.com/alexandrainst/node-red-contrib-parser-ini/network/alert/package-lock.json/lodash/open So it would be nice to issue a new jshint release ASAP to offer an easy way forward for those projects with a (dev) dependency to jshint. https://github.com/lodash/lodash/wiki/Changelog

view details

Mike Pennisi

commit sha b02a025f95f2c7cace8a4db482e2a926d074378f

[[FIX]] Disallow invalid numeric literals

view details

Mike Pennisi

commit sha 3b2c8cfa2836d1e620334b4a7d3a01bf5e3c529e

[[FIX]] Disallow leading zeros in BigInts

view details

Mike Pennisi

commit sha 1806ddb4a6dc1a36bbf8e3b8235953e0501e786c

v2.11.2

view details

Mike Pennisi

commit sha 297f8cea568628611276b8e8d0e6ef47b53afc15

[[CHORE]] Revert "Count ternary and or operators for complexity" JSHint's tracking of cyclomatic complexity within Conditional Expressions and Or Expressions is derived from code first contributed by Tim Ruffles <timruffles@googlemail.com>. That contributor could not be reached to sign JSHint's Contributor License Agreement. Revert their contribution to the application logic (preserving the corresponding MIT-licensed test code) so that it may be re-written under the terms of the Contributor License Agreement. Revert the changes introduced by 87e3e6ccfb3c37417a56946dce5904742bd43311

view details

Matt Surabian

commit sha 7a5948c64b5b3937e422843c0234f7a4685bba68

Evaluate the or symbol to account for complexity increase

view details

Matt Surabian

commit sha 8a205a808582579592d5301bba587894e3a824c8

Increase complexity count when encountering the ternary operator

view details

Mike Pennisi

commit sha e6ad7a2322f1bfdc8d7e41ad3150972772007677

Merge branch 'reimplement-complexity-count'

view details

Mike Pennisi

commit sha c7a7c66128b8eaaa0423e5d600a72fa1742cca59

[[CHORE]] Revert "Add codes to errors generated by quit()" JSHint's emission of the `code` property of errors from the internal `quit` function is derived from code first contributed by Nikolay S. Frantsev <privatbank@frantsev.ru>. That contributor could not be reached to sign JSHint's Contributor License Agreement. Revert their contribution to the application logic (preserving the corresponding MIT-licensed test code) so that it may be re-written under the terms of the Contributor License Agreement. Revert the changes introduced by 537dcbd4be49f5b52ede08e98b23e49bbc5e4bbc

view details

Tyler Kellen

commit sha 94d7f239da4b2ae300b2342af0b777a489f63765

add missing error code context

view details

Mike Pennisi

commit sha a683c100bc024fe3d11d575764a3ddb4b15615e6

Merge branch 'reimplement-quit-code'

view details

Mike Pennisi

commit sha d65513c54ac00188bba3987383bf09ac50c8d463

[[FEAT]] Update project license

view details

Mike Pennisi

commit sha a9dbe4f3559c75a0ead9de26da54bdee0869f5dd

v2.12.0

view details

Mike Pennisi

commit sha 18f977e0eb699badc4463b441bafbe39edba47f1

[[CHORE]] Correct link in change log

view details

Mike Pennisi

commit sha 0d9f6fd4cd539a588f01d06cf6b082192a6be446

[[CHORE]] Recognize 'esversion: 11' This commit extends the options parsing system to tolerate the values "11" and "2020" for the `esversion` linting option. It does not introduce support for any features introduced by the new edition of the language.

view details

Mike Pennisi

commit sha 876323948cd350cd1d6636635b4a798a0c21dc79

[[FIX]] Graduate BigInt support to `esversion: 11`

view details

push time in a month

PR opened jshint/jshint

Reviewers
Simplifier treatment of property names
+28 -44

0 comment

1 changed file

pr created time in a month

create barnchjugglinmike/jshint

branch : identifier-cleanup

created branch time in a month

push eventweb-platform-tests/wpt

Rick Waldron

commit sha f0fa908631e5b8fae2c0769ea1fa25672482fc88

[weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver (#25496) * [weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver * fixup! [weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver * fixup! fixup! [weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver

view details

push time in a month

PR merged web-platform-tests/wpt

[weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver js status:needs-reviewers

@jugglinmike these are variants of https://github.com/web-platform-tests/wpt/blob/master/js/builtins/weakrefs/gc-has-one-chance-to-call-cleanupCallback.optional.any.js, where the generic await ticks++; has been replaced with:

  • queueMicrotask
  • queueMicrotaskByMutationObserver (which is a wrapper around a mutation observer)
+233 -8

1 comment

3 changed files

rwaldron

pr closed time in a month

PullRequestReviewEvent

PR opened jhpyle/docassemble

Correct typo
+1 -1

0 comment

1 changed file

pr created time in a month

create barnchbocoup/docassemble

branch : docs-review-typo

created branch time in a month

Pull request review commentweb-platform-tests/wpt

[weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver

+// META: script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// ├──> maybeGarbageCollectAsync+// └──> resolveGarbageCollection+/*---+esid: sec-finalization-registry-target+info: |+  FinalizationRegistry ( cleanupCallback )++  FinalizationRegistry.prototype.cleanupSome ( [ callback ] )++  ...+  4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception.+  5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback).+  6. Return undefined.++  Execution++  At any time, if an object obj is not live, an ECMAScript implementation may perform the following steps atomically:++  1. For each WeakRef ref such that ref.[[Target]] is obj,+    a. Set ref.[[Target]] to empty.+  2. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains cell, such that cell.[[Target]] is obj,+    a. Set cell.[[Target]] to empty.+    b. Optionally, perform ! HostCleanupFinalizationRegistry(finalizationRegistry).+---*/+++let cleanupCallback = 0;+let holdings = [];+function cb(holding) {+  holdings.push(holding);+}++let finalizationRegistry = new FinalizationRegistry(function() {+  cleanupCallback += 1;+});++function emptyCells() {+  let target = {};+  finalizationRegistry.register(target, 'a');++  let prom = maybeGarbageCollectAndCleanupAsync(target);+  target = null;++  return prom;+}++function queueMicrotaskByMutationObserver(callback) {+  const textNode = document.createTextNode('');+  new MutationObserver(callback).observe(textNode, { characterData: true });+  textNode.data = 1;+}++promise_test(() => {+  return (async () => {+    assert_implements(+      typeof FinalizationRegistry.prototype.cleanupSome === 'function',+      'FinalizationRegistry.prototype.cleanupSome is not implemented.'+    );++    assert_implements(+      typeof MutationObserver === 'function'

Missing here, too

rwaldron

comment created time in a month

Pull request review commentweb-platform-tests/wpt

[weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver

+// META: script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// ├──> maybeGarbageCollectAsync+// └──> resolveGarbageCollection+/*---+esid: sec-finalization-registry-target+info: |+  FinalizationRegistry ( cleanupCallback )++  FinalizationRegistry.prototype.cleanupSome ( [ callback ] )++  ...+  4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception.+  5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback).+  6. Return undefined.++  Execution++  At any time, if an object obj is not live, an ECMAScript implementation may perform the following steps atomically:++  1. For each WeakRef ref such that ref.[[Target]] is obj,+    a. Set ref.[[Target]] to empty.+  2. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains cell, such that cell.[[Target]] is obj,+    a. Set cell.[[Target]] to empty.+    b. Optionally, perform ! HostCleanupFinalizationRegistry(finalizationRegistry).+---*/+++let cleanupCallback = 0;+let holdings = [];+function cb(holding) {+  holdings.push(holding);+}++let finalizationRegistry = new FinalizationRegistry(function() {+  cleanupCallback += 1;+});++function emptyCells() {+  let target = {};+  finalizationRegistry.register(target, 'a');++  let prom = maybeGarbageCollectAndCleanupAsync(target);+  target = null;++  return prom;+}++promise_test(() => {+  return (async () => {+    assert_implements(+      typeof FinalizationRegistry.prototype.cleanupSome === 'function',+      'FinalizationRegistry.prototype.cleanupSome is not implemented.'+    );++    assert_implements(+      typeof queueMicrotask === 'function'

We're missing a comma in this arguments list

rwaldron

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

delete branch bocoup/docassemble

delete branch : docs-markdown-inline-code

delete time in a month

issue commentjshint/jshint

change line/col logging to allow for editor hyperlinking

I'd be supportive of a change like this if we had some concrete examples of widely-used editors which recognized the pattern.

Alternatively, you can build your own solution without forking JSHint itself. Check out the documentation on writing a custom reporter.

nektro

comment created time in a month

issue commentjshint/jshint

Setting browser:true in .jshintrc does not cover some globals

Sounds about right to me. This is a good first issue--@rbruckheimer has explained exactly what needs to be done.

rbruckheimer

comment created time in a month

issue closedjshint/jshint

CLA is offline (whole CLAhub it seems)

https://www.clahub.com/agreements/jshint/jshint points to an empty Heroku page.

As the contribution guidelines require the signing of the CLA, it might make sense to solve this issue.

closed time in a month

silverhook

create barnchbocoup/docassemble

branch : docs-markdown-inline-code

created branch time in a month

fork jugglinmike/docassemble

A free, open-source expert system for guided interviews and document assembly, based on Python, YAML, and Markdown.

https://docassemble.org

fork in a month

Pull request review commentweb-platform-tests/wpt

[weakref] FinalizationRegistry.prototype.cleanupSome & "maybe" GC interleaved with queueMicrotask, MutationObserver

+// META: script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// ├──> maybeGarbageCollectAsync+// └──> resolveGarbageCollection+/*---+esid: sec-finalization-registry-target+info: |+  FinalizationRegistry ( cleanupCallback )++  FinalizationRegistry.prototype.cleanupSome ( [ callback ] )++  ...+  4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception.+  5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback).+  6. Return undefined.++  Execution++  At any time, if an object obj is not live, an ECMAScript implementation may perform the following steps atomically:++  1. For each WeakRef ref such that ref.[[Target]] is obj,+    a. Set ref.[[Target]] to empty.+  2. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains cell, such that cell.[[Target]] is obj,+    a. Set cell.[[Target]] to empty.+    b. Optionally, perform ! HostCleanupFinalizationRegistry(finalizationRegistry).+---*/+++let cleanupCallback = 0;+let called = 0;+function cb(holding) {+  assert_equals(holding, 'a');+  called += 1;+}

In WPT, an uncaught exception will be interpreted as a harness error rather than a test failure. I recommend pushing the callback's argument value to an array. Then, you can assert the value in the test body (you could also replace called with the length of the new array).

That would also be a good improvement for the Test262 test upon which this code is based (that is, even where there is no error/failure distinction). As written, the test relies on the implementation to correctly propagate abrupt completions originating from the callback to cleanupSome. Verifying that specific behavior with a new test will reduce the risk of false positives in this one.

rwaldron

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

PR closed w3c/ServiceWorker

Override the "mode" of Service Worker requests

Tests for this behavior have already been merged to WPT:

https://github.com/web-platform-tests/wpt/blob/1740f4c70674b363cce9fddd19eb4110a54d609e/fetch/metadata/serviceworker.https.sub.html

Firefox 82 and Chromium 86 both implement this behavior:

https://wpt.fyi/results/fetch/metadata/serviceworker.https.sub.html?run_id=645350001&run_id=647020002&run_id=641150001&run_id=657230003

We could also specify this by extending an existing step that concerns other workers. In a patch to do that, it was suggested that Service Workers was the more appropriate location.

<!-- This comment and the below content is programatically generated. You may add a comma-separated list of anchors you'd like a direct link to below (e.g. #idl-serializers, #idl-sequence):

Don't remove this comment or modify anything below this line.
If you don't want a preview generated for this pull request,
just replace the whole of this comment's content by "no preview"
and remove what's below.

-->


<a href="https://pr-preview.s3.amazonaws.com/bocoup/ServiceWorker/pull/1534.html" title="Last updated on Aug 31, 2020, 6:05 PM UTC (838a6e7)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/ServiceWorker/1534/e4c2953...bocoup:838a6e7.html" title="Last updated on Aug 31, 2020, 6:05 PM UTC (838a6e7)">Diff</a>

+1 -0

3 comments

1 changed file

jugglinmike

pr closed time in 2 months

pull request commentw3c/ServiceWorker

Override the "mode" of Service Worker requests

@wanderview you're right. The discussion of https://github.com/whatwg/html/pull/5875 has more information about why this patch affects more requests than intended. I ought to have closed this when that became apparent--sorry for the distraction!

@jakearchibald @wanderview Would you mind confirming that the other patch is how we should address this?

jugglinmike

comment created time in 2 months

push eventweb-platform-tests/wpt

Rick Waldron

commit sha e5f105ebb6f1096c5c98ed639fdadec73542119d

WeakRef/FinalizationRegistry testing (#24982)

view details

push time in 2 months

PR merged web-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing infra js weakrefs

@syg @leobalter This set of tests are built from the Test262 tests that allow for "maybe" garbage collection. Our harness utilities have been ported over, but with more obvious naming to make everything as clear as possible.

Once these are approved and merged, I will move on to writing additional tests that cover interactions across various async web APIs ("things that micro task").

+569 -0

5 comments

9 changed files

rwaldron

pr closed time in 2 months

PullRequestReviewEvent

Pull request review commentweb-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing

+// META script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// └──> resolveGarbageCollection+/*---+esid: sec-properties-of-the-finalization-registry-constructor+info: |+  FinalizationRegistry.prototype.cleanupSome ( [ callback ] )++  1. Let finalizationRegistry be the this value.+  ...+  5. Perform ! CleanupFinalizationRegistry(finalizationRegistry, callback).+  ...++  CleanupFinalizationRegistry ( finalizationRegistry [ , callback ] )++  ...+  3. While finalizationRegistry.[[Cells]] contains a Record cell such that cell.[[WeakRefTarget]] is ~empty~, then an implementation may perform the following steps,+    a. Choose any such cell.+    b. Remove cell from finalizationRegistry.[[Cells]].+    c. Perform ? Call(callback, undefined, << cell.[[HeldValue]] >>).++---*/++function check(value, expectedName) {+  let holdings = [];+  let called = 0;+  let finalizationRegistry = new FinalizationRegistry(function() {});++  function callback(holding) {+    called += 1;+    holdings.push(holding);+  }++  // This is internal to avoid conflicts+  function emptyCells(value) {+    let target = {};+    finalizationRegistry.register(target, value);++    let prom = maybeGarbageCollectAndCleanupAsync(target);+    target = null;++    return prom;+  }++  return emptyCells(value).then(function() {+    finalizationRegistry.cleanupSome(callback);+    assert_equals(called, 1, expectedName);+    assert_equals(holdings.length, 1, expectedName);+    assert_equals(holdings[0], value, expectedName);+  });+}++promise_test(() => {+  assert_implements(+    typeof FinalizationRegistry.prototype.cleanupSome === 'function',+    'FinalizationRegistry.prototype.cleanupSome is not implemented.'+  );++  return Promise.all([+    check(undefined, 'undefined'),+    check(null, 'null'),

Each call to "check" is actually a distinct test. In WPT, a test file is composed of one or more subtests--you can call promise_test more than once. We should do that here for two reasons:

  • it will give implementers a clearer picture of what's going wrong when the test fails
  • it will promote stability (as written, the test will fail with a message that describes whatever "check" happened to fail first. I have a feeling that won't be deterministic)

Sorry for the late-stage feedback; this only just dawned on me.

rwaldron

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentweb-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing

+// META script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// └──> resolveGarbageCollection+/*---+esid: sec-finalization-registry.prototype.cleanupSome+info: |+  FinalizationRegistry.prototype.cleanupSome ( [ callback ] )++  1. Let finalizationRegistry be the this value.+  2. If Type(finalizationRegistry) is not Object, throw a TypeError exception.+  3. If finalizationRegistry does not have a [[Cells]] internal slot, throw a TypeError exception.+  4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception.+  5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback).+  6. Return undefined.+---*/++let holdingsList = [];+function cb(holding) {+  holdingsList.push(holding);+};+let finalizationRegistry = new FinalizationRegistry(function() {});++let referenced = {};++function emptyCells() {+  let target = {};+  finalizationRegistry.register(target, 'target!');+  finalizationRegistry.register(referenced, 'referenced');++  let prom = maybeGarbageCollectAndCleanupAsync(target);+  target = null;++  return prom;+}++async function execAsync() {

This pattern is a little hard for me to follow because the exception value weaves between being a rejection and a fulfillment, so it's hard to track the way the promise is fulfilled.

(async () => {
  try {
    // test code
  } catch (error) {
    return error;
  }
})().then((errorOrUndefined) => {
  if (errorOrUndefined && errorOrUndefined !== maybeGarbageCollectAndCleanupAsync.NOT_COLLECTED) {
    throw error;
  }
});

If we allow the exception to consistently follow the "rejection" route, then we can simplify the call site and (hopefully) improve legibility:

(async () => {
  // test code
})().catch((error) => { // swapping `catch` for `then`
  if (error !== maybeGarbageCollectAndCleanupAsync.NOT_COLLECTED) {
    throw error;
  }
});
rwaldron

comment created time in 2 months

Pull request review commentweb-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing

+/**+ * maybeGarbageCollectAsync+ *+ * It might garbage collect, it might not. If it doesn't, that's ok.+ *+ * Based on "(default export)" in+ * https://github.com/web-platform-tests/wpt/pull/22835/files#diff-fba53ea423a12f40917f41ba4ffadf1e, and "$262.gc()"+ * defined in https://github.com/tc39/test262/blob/main/INTERPRETING.md+ *+ *+ * @return {undefined}+ */+async function maybeGarbageCollectAsync() {+  if (typeof TestUtils !== 'undefined' && TestUtils.gc) {+    await TestUtils.gc();+  } else if (self.gc) {+    // Use --expose_gc for V8 (and Node.js)+    // to pass this flag at chrome launch use: --js-flags="--expose-gc"+    // Exposed in SpiderMonkey shell as well+    await self.gc();+  } else if (self.GCController) {+    // Present in some WebKit development environments+    await GCController.collect();+  }+  /* eslint-disable no-console */+  console.warn('Tests are running without the ability to do manual ' ++               'garbage collection. They will still work, but ' ++               'coverage will be suboptimal.');+  /* eslint-enable no-console */+}++/**+ * maybeGarbageCollectKeptObjectsAsync+ *+ * Based on "asyncGCDeref" in https://github.com/tc39/test262/blob/master/harness/async-gc.js+ *+ * @return {Promise} Resolves to a trigger if ClearKeptObjects+ *                   exists to provide one+ */+async function maybeGarbageCollectKeptObjectsAsync() {+  let trigger;++  if (typeof ClearKeptObjects === 'function') {+    trigger = ClearKeptObjects();+  }++  await maybeGarbageCollectAsync();++  return Promise.resolve(trigger);

Promise.resolve looks like a vestige from some prior iteration where the surrounding function was not an async function. Is it necessary in this context?

rwaldron

comment created time in 2 months

Pull request review commentweb-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing

+/**+ * maybeGarbageCollectAsync+ *+ * It might garbage collect, it might not. If it doesn't, that's ok.+ *+ * Based on "(default export)" in+ * https://github.com/web-platform-tests/wpt/pull/22835/files#diff-fba53ea423a12f40917f41ba4ffadf1e, and "$262.gc()"+ * defined in https://github.com/tc39/test262/blob/main/INTERPRETING.md+ *+ *+ * @return {undefined}+ */+async function maybeGarbageCollectAsync() {+  if (typeof TestUtils !== 'undefined' && TestUtils.gc) {+    await TestUtils.gc();+  } else if (self.gc) {+    // Use --expose_gc for V8 (and Node.js)+    // to pass this flag at chrome launch use: --js-flags="--expose-gc"+    // Exposed in SpiderMonkey shell as well+    await self.gc();+  } else if (self.GCController) {+    // Present in some WebKit development environments+    await GCController.collect();+  }+  /* eslint-disable no-console */+  console.warn('Tests are running without the ability to do manual ' ++               'garbage collection. They will still work, but ' ++               'coverage will be suboptimal.');+  /* eslint-enable no-console */+}++/**+ * maybeGarbageCollectKeptObjectsAsync+ *+ * Based on "asyncGCDeref" in https://github.com/tc39/test262/blob/master/harness/async-gc.js+ *+ * @return {Promise} Resolves to a trigger if ClearKeptObjects+ *                   exists to provide one+ */+async function maybeGarbageCollectKeptObjectsAsync() {+  let trigger;++  if (typeof ClearKeptObjects === 'function') {+    trigger = ClearKeptObjects();+  }++  await maybeGarbageCollectAsync();++  return Promise.resolve(trigger);+}++/**+ * maybeGarbageCollectAndCleanupAsync+ *+ * Based on "asyncGC" in https://github.com/tc39/test262/blob/master/harness/async-gc.js+ *+ * @return {undefined}+ */+async function maybeGarbageCollectAndCleanupAsync(...targets) {+  let finalizationRegistry = new FinalizationRegistry(() => {});+  let length = targets.length;++  for (let target of targets) {+    finalizationRegistry.register(target, 'target');+    target = null;+  }++  targets = null;++  await 'tick';+  await maybeGarbageCollectKeptObjectsAsync();++  let names = [];++  finalizationRegistry.cleanupSome(name => names.push(name));++  if (names.length !== length) {+    throw maybeGarbageCollectAndCleanupAsync.NOT_COLLECTED;+  }+}++maybeGarbageCollectAndCleanupAsync.NOT_COLLECTED = Symbol('Object was not collected');++/**+ * resolveGarbageCollection+ *+ * Based on "resolveAsyncGC" in https://github.com/tc39/test262/blob/master/harness/async-gc.js+ *+ * @param  {Error} error An error object.+ * @return {undefined}+ */+function resolveGarbageCollection(error, done) {

done is unused

rwaldron

comment created time in 2 months

Pull request review commentweb-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing

+// META script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// └──> resolveGarbageCollection+/*---+esid: sec-properties-of-the-finalization-registry-constructor+info: |+  FinalizationRegistry.prototype.cleanupSome ( [ callback ] )++  1. Let finalizationRegistry be the this value.+  ...+  5. Perform ! CleanupFinalizationRegistry(finalizationRegistry, callback).+  ...++  CleanupFinalizationRegistry ( finalizationRegistry [ , callback ] )++  ...+  3. While finalizationRegistry.[[Cells]] contains a Record cell such that cell.[[WeakRefTarget]] is ~empty~, then an implementation may perform the following steps,+    a. Choose any such cell.+    b. Remove cell from finalizationRegistry.[[Cells]].+    c. Perform ? Call(callback, undefined, << cell.[[HeldValue]] >>).++---*/++function check(value, expectedName) {+  let holdings = [];+  let called = 0;+  let finalizationRegistry = new FinalizationRegistry(function() {});++  function callback(holding) {+    called += 1;+    holdings.push(holding);+  }++  // This is internal to avoid conflicts+  function emptyCells(value) {+    let target = {};+    finalizationRegistry.register(target, value);++    let prom = maybeGarbageCollectAndCleanupAsync(target);+    target = null;++    return prom;+  }++  return emptyCells(value).then(function() {+    finalizationRegistry.cleanupSome(callback);+    assert_equals(called, 1, expectedName);+    assert_equals(holdings.length, 1, expectedName);+    assert_equals(holdings[0], value, expectedName);+  });+}++promise_test(() => {+  assert_implements(+    typeof FinalizationRegistry.prototype.cleanupSome === 'function',+    'FinalizationRegistry.prototype.cleanupSome is not implemented.'+  );++  return Promise.all([+    check(undefined, 'undefined'),+    check(null, 'null'),+    check('', 'the empty string'),+    check({}, 'object'),+    check(42, 'number'),+    check(true, 'true'),+    check(false, 'false'),+    check(Symbol(1), 'symbol'),+  ]).then(resolveGarbageCollection, resolveGarbageCollection);

I don't think we want to use resolveGarbageCollection in the fulfillment handler. When the promise from Promise.all is fulfilled, it will always be an Array, and that will never equal maybeGarbageCollectAndCleanupAsync.NOT_COLLECTED, so the test will fail with a reason of the array value. I have thoughts about refactoring this pattern generally, but I'll share those in a separate comment.

rwaldron

comment created time in 2 months

Pull request review commentweb-platform-tests/wpt

[weakref] WeakRef/FinalizationRegistry, cleanupSome testing

+// META script=resources/maybe-garbage-collect.js+// ├──> maybeGarbageCollectAndCleanupAsync+// └──> resolveGarbageCollection

Very nice!

rwaldron

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

pull request commentwhatwg/html

Override the "mode" of Service Worker requests

@domenic I think you're right: it seems likely that I overlooked how the "perform the fetch" steps are applied. That may be an area for improvement, so I've filed a separate issue to confirm my interpretation and suggest a change.

jugglinmike

comment created time in 2 months

issue openedwhatwg/html

Explicitly pass "perform the fetch" steps through dependent algorithms

Currently, HTML references the custom "perform the fetch" steps in a way that makes it a little difficult to understand how those steps influence overall script retrieval.

Fetch a module worker script graph directly invokes fetch a single module script to retrieve the entry point to a script graph. When it does this, it explicitly forwards the "perform the fetch" steps that callers can optionally provide.

The algorithm delegates retrieval of the rest of the graph to fetch the descendants of and link a module script, but it does not reference the optional "perform the fetch" steps. This suggests that the steps are not relevant for the retrieval of the descendants. Similarly, the steps are not referenced in the corresponding call to fetch the descendants of a module script. Only by reviewing the steps of that algorithm (twice removed from "fetch a module worker script") can one learn that retrieval of the descendants may be affected by the custom "perform the fetch" steps:

  1. For each url in urls, perform the internal module script graph fetching procedure given url, fetch client settings object, destination, options, module script's settings object, visited set, and module script's base URL. If the caller of this algorithm specified custom perform the fetch steps, pass those along while performing the internal module script graph fetching procedure.

This wording is somewhat unclear, though: this algorithm currently has two call sites in HTML, and neither of them specify custom "perform the fetch" steps. This makes me think the term "caller" may encompass the entire "call stack" as it were. However, it's also possible that the condition is truly limited to direct callers and simply describing call sites that exist outside of HTML.

If the former is true, then this would be greatly clarified if the intervening algorithms accepted the steps as input and passed them along explicitly.

@domenic This feels similar to work you've been doing to improve coherence. Apologies if it's already on your radar; my search didn't turn anything up.

created time in 2 months

issue commentmholt/PapaParse

ATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

@arnaudjnn It looks like your input data is too large for your system to hold in memory. When you specify a step function, you enable the tool's streaming mode, so it releases objects as it parses.

@pip77 I saw this too specifically while using a Node.js stream as input. Pausing that stream in addition to the parser solved the problem for me.

 'use strict';
 const fs = require('fs');
 const papaparse = require('papaparse');

 const inFile = fs.createReadStream(process.argv[2], {encoding: 'utf-8'});
 papaparse.parse(inFile, {
   async chunk(row, parser) {
     if (row.errors.length) {
       console.error(row);
       return;
     }
     parser.pause();
+    inFile.pause();
     await new Promise((resolve) => setTimeout(resolve, 2000));
+    inFile.resume();
     parser.resume();
   }
 });
arnaudjnn

comment created time in 2 months

push eventbocoup/wpt

Mike Pennisi

commit sha b08cf9dbfe3aed3ecd6ef85f0d7883a2af72dfac

[html] Add tests for COOP in multipart responses

view details

push time in 2 months

push eventbocoup/wpt

Tab Atkins Jr

commit sha 31bf745dee7797144c8c0144af9ac98395997282

grid-template-areas must define at least one cell (#24703)

view details

fantasai

commit sha 8c10ee66eecf1a65bc0b11214025b6a31c77902a

[css-grid-1] Show grid cell sizes to test against undersizing.

view details

Gérard Talbot

commit sha 1ff6f44a481618f5f4dc050d664052b286b7c3ba

Corrected active-selection-056, added active-selection-057 tests (#24706)

view details

Gérard Talbot

commit sha b3199ab86758b06882e03f1e014e1644927b8477

Improved active-selection-063.html (#24709)

view details

Stephen McGruer

commit sha 0cc1eb61d81b71834c47960d5b6cc51494f92696

Add interfaces/dom-overlays.idl and test (#24634) Closes https://github.com/web-platform-tests/wpt/pull/24192

view details

Marijn Kruisselbrink

commit sha eb8925a5c847701f4a5b8095600d7e1b8aac2269

[NativeFS] Keep directory iterator alive while it has pending promises. Should hopefully also fix test flakiness where tests seemed to already be running into this. Fixed: 1074123 Change-Id: If57c8d6f622c17d795bc1429f66485cda94befd2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2313763 Reviewed-by: Victor Costan <pwnall@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/master@{#791122}

view details

James Graham

commit sha 8e2d081aa5834c63ef04200715f79d501830160f

Add a --install-webdriver argument to wpt run This forces installing WebDriver even if it's already on the path. Also use this argument for wpt runs

view details

James Graham

commit sha e8dc77b848d5fbbf0270b83ce74497ce8b81e50d

Ensure we pass the browser channel in to install_webdriver

view details

James Graham

commit sha 59cec4f843d5c86d5d2e99d636e465e09807cafb

Make a clearer distinction between wpt run kwargs and wptrunner kwargs

view details

Cameron McCormack

commit sha e60c6ef6c4b0de0d823d7b09262cf364f7356ad3

Part 3: Defer to -moz-default-appearance when appearance is auto. Differential Revision: https://phabricator.services.mozilla.com/D83429 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1620467 gecko-commit: d96951bf852ede4060885463d8b0cc6c4b9f758c gecko-integration-branch: autoland gecko-reviewers: emilio

view details

Cameron McCormack

commit sha 3a4291d51fb810692863ae4feb7ad8c1da467b88

Part 4: Change internal uses of -moz-appearance to appearance and -moz-default-appearance. Uses of `-moz-appearance: none` are changed to `appearance: none`. Uses of other values that are simply reverting the appearance back to its default are changed to `appearance: auto`. Uses of values in UA sheets that are defining the inherent appearance of widgets are changed to: appearance: auto; -moz-default-appearance: <value>; since those values are either no longer supported on (-moz-)appearance, or are still supported but only in some limited form. There are some uses of `-moz-appearance: textfield` on <input type=number> elements that are renamed to `appearance: textfield`. Differential Revision: https://phabricator.services.mozilla.com/D83430 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1620467 gecko-commit: 7acbe8938c4eebca7ee68a37631479c699ca8393 gecko-integration-branch: autoland gecko-reviewers: emilio, webcompat-reviewers, geckoview-reviewers, preferences-reviewers, ntim, agi, miketaylr

view details

Cameron McCormack

commit sha 4eaf8186a5086ff68f1c8fab15e51fd56e9d37a2

Part 8: Make `appearance: button` behave like auto on various elements. Differential Revision: https://phabricator.services.mozilla.com/D83434 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1620467 gecko-commit: 33a0e212af05d479324ee9d04cb0a652979b63d1 gecko-integration-branch: autoland gecko-reviewers: emilio

view details

Cameron McCormack

commit sha cfadf4ee2c07bbd76c91f4a74c1d4559101d6d12

Part 10: Make remaining appearance values behave like auto. This includes all of the <compat-auto> values, plus menulist-button, which doesn't behave any differently from menulist currently. Differential Revision: https://phabricator.services.mozilla.com/D83436 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1620467 gecko-commit: 2d55f97dbe384e8be7728fbf5b3564e08a711dac gecko-integration-branch: autoland gecko-reviewers: emilio

view details

Cameron McCormack

commit sha 3213fab1ef2efd2e5eb69715b1867567f66c741d

Part 12: Hide range and number-input appearance values from content. Forgot to follow up on these two remaining non-standard values that may have been being used to reset a <meter> or <input type=number> back to its original appearance, but which telemetry showed no usage of. Differential Revision: https://phabricator.services.mozilla.com/D83598 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1620467 gecko-commit: 4b04d694fb5c80287ed777013214f672236197cb gecko-integration-branch: autoland gecko-reviewers: emilio

view details

Cameron McCormack

commit sha 0d6375116ece2479a92ca065f9d1d946d858a66a

Avoid breaking update-built-tests. Differential Revision: https://phabricator.services.mozilla.com/D84633 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1620467 gecko-commit: dad0301e55affb9e6077009906c690a6f4d98ea0 gecko-integration-branch: autoland

view details

Cameron McCormack

commit sha 6acadcbe2bf13d9b7145d0a8293d965826956ff4

Look to the correct frame when determining root element styles for "potentially scrollable" check. Differential Revision: https://phabricator.services.mozilla.com/D84280 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1654099 gecko-commit: 76bbb83349bb0cb72b599611d5559707fd9a8d48 gecko-integration-branch: autoland gecko-reviewers: emilio

view details

Philip Jägenstedt

commit sha 3a4df855d0f093a129f79978b89129f505c846b8

Add interfaces/gamepad-extensions.idl and test (#24660) * Add interfaces/gamepad-extensions.idl Source: https://github.com/tidoust/reffy-reports/blob/11380ca/ed/idl/gamepad-extensions.idl Build: https://travis-ci.org/tidoust/reffy-reports/builds/654757585 * Add gamepad/idlharness-extensions.window.js Co-authored-by: autofoolip <auto@foolip.org>

view details

Maxim Tsoy

commit sha c44373f6983ff55d3482a297b3a7e0d0a6dec03c

Test media elements do not block document load Follows https://github.com/whatwg/html/pull/5738.

view details

Alexey Shvayka

commit sha 92920b6973e896022020f22c5566db51575c95c1

Add WebAssembly[Symbol.toStringTag] test

view details

Alexey Shvayka

commit sha e30b9f513375eb20c03ec6fa569fb8c68cbe5447

Add CSS[Symbol.toStringTag] test

view details

push time in 2 months

more