-
Notifications
You must be signed in to change notification settings - Fork 13
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
Won't work for sub functions #18
Comments
@twada Is this working on your projects? |
I found this is caused by the update of espurify. |
@falsandtru Oh thank you for reporting. I'm going to investigate this issue. |
Thanks. |
@falsandtru I cannot reproduce the case since |
Did you test after clean install? |
yes $ mkdir pd-unassert
$ cd pd-unassert
$ npm init -y
Wrote to /Users/takuto/work/pd-unassert/package.json:
{
"name": "pd-unassert",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
$ npm install --save-dev unassert-cli
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
added 43 packages from 130 contributors and audited 43 packages in 3.71s
9 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ cat <<EOT >> prod.js
heredoc> const assert = require('assert');
heredoc> function fail() {
heredoc> throw new Error('fail');
heredoc> }
heredoc> assert.doesNotThrow(function () {
heredoc> fail();
heredoc> });
heredoc> EOT
$ cat prod.js
const assert = require('assert');
function fail() {
throw new Error('fail');
}
assert.doesNotThrow(function () {
fail();
});
$ npx unassert prod.js
function fail() {
throw new Error('fail');
}
$ |
Indeed. I couldn't make a simple repro. FYI, the leaked assertions are this: falsandtru/pjax-api@265f135. Since they are few (almost all assertions are removed), this bug is stateful. Can you release the updated version at first? |
The current repro:
|
@falsandtru Thank you for your repro case! I'm going to find the root cause and fix it. |
Since the current espurify is broken, can you release v2.0.1 as the latest? |
No, no, espurify is not broken but unssert do. I'll cut some bugfix releases ASAP. |
OK. |
First I've tagged [email protected] as latest. |
That's what I intended. Thanks. |
Revert relase [2.1.0](https://github.com/estools/espurify/releases/tag/v2.1.0) since it affects to AST matching logic and breaks [some usecases](unassert-js/unassert#18).
Revert relase [2.1.0](https://github.com/estools/espurify/releases/tag/v2.1.0) since it affects to AST matching logic and breaks [some usecases](unassert-js/unassert#18).
Now the sub functions such as assert.doesNotThrow won't be removed. Probably this is a bug on the upstream.
The text was updated successfully, but these errors were encountered: