aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/compress.js7
-rw-r--r--test/compress/default-values.js22
2 files changed, 27 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index bcffd8b8..8652d6e4 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4957,7 +4957,10 @@ merge(Compressor.prototype, {
node.right.walk(tw);
var marker = new TreeWalker(function(node) {
if (node instanceof AST_Destructured) return;
- if (node instanceof AST_DestructuredKeyVal) {
+ if (node instanceof AST_DefaultValue) {
+ node.value.walk(tw);
+ node.name.walk(marker);
+ } else if (node instanceof AST_DestructuredKeyVal) {
if (node.key instanceof AST_Node) {
push();
segment.block = node;
@@ -5177,7 +5180,7 @@ merge(Compressor.prototype, {
node.name.mark_symbol(node.value ? function(node) {
if (!(node instanceof AST_SymbolDeclaration)) return;
if (node instanceof AST_SymbolVar) {
- mark(node, false);
+ mark(node);
} else {
references[node.definition().id] = false;
}
diff --git a/test/compress/default-values.js b/test/compress/default-values.js
index 8e5910d9..23e31748 100644
--- a/test/compress/default-values.js
+++ b/test/compress/default-values.js
@@ -1527,3 +1527,25 @@ issue_4510_2: {
expect_stdout: "PASS"
node_version: ">=8"
}
+
+issue_4523: {
+ options = {
+ merge_vars: true,
+ }
+ input: {
+ console.log(function() {
+ var a, b;
+ [ a = b = false ] = [ "FAIL" ];
+ return b || "PASS";
+ }());
+ }
+ expect: {
+ console.log(function() {
+ var a, b;
+ [ a = b = false ] = [ "FAIL" ];
+ return b || "PASS";
+ }());
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}
2021-09-15store: 'map/accumulate-builds' processes the whole list in case of cutoff....Fixes <https://issues.guix.gnu.org/50264>. Reported by Lars-Dominik Braun <lars@6xq.net>. This fixes a regression introduced in fa81971cbae85b39183ccf8f51e8d96ac88fb4ac whereby 'map/accumulate-builds' would return REST (the tail of LST) without applying PROC on it. The effect would be that 'lower-inputs' in (guix gexp) would dismiss those elements, leading to derivations with correct builders but only a subset of the inputs they should have had. * guix/store.scm (map/accumulate-builds): Add #:cutoff parameter and remove 'accumulation-cutoff' variable. Call PROC on the elements of REST. * tests/store.scm ("map/accumulate-builds cutoff"): New test. Ludovic Courtès 2021-07-05tests: Fix typo in 'tests/store.scm'....This typo had always been there since the test was introduced in commit ce72c780746776a86f59747f5eff8731cb4ff39b. Presumably, it became visible with 9e5812ac59b01ff011ec0c5b0f437dfe85d6fcc7, where caching was no longer global and thus the 'store' argument of 'package-derivation' was actually being used. * tests/store.scm ("current-build-output-port, UTF-8"): Refer to '%store' rather than 's' in 'package-derivation' call. Ludovic Courtès 2021-06-08store: Remove 'references/substitutes'....This procedure lost its only user in commit 710854304b1ab29332edcb76f3de532e0724c197. * guix/store.scm (references/substitutes): Remove. * tests/store.scm ("references/substitutes missing reference info") ("references/substitutes with substitute info"): Remove. Ludovic Courtès 2021-03-18tests: Make the STORE test more robust in a "pure" environment....Otherwise, the test crashes (not fails) when run in `guix environment --pure guix`. Fixes <https://bugs.gnu.org/46445>. * tests/store.scm (%shell): Fallback to "/bin/sh". Leo Famulari 2021-01-22store: Add 'find-roots' RPC....* guix/serialization.scm (read-string-pairs): New procedure. * guix/store.scm (read-arg): Add support for 'string-pairs'. (find-roots): New procedure. * tests/store.scm ("add-indirect-root and find-roots"): New test. Ludovic Courtès 2020-12-19tests: Make sure substituted items are deduplicated....* tests/store.scm ("substitute, deduplication"): New test. Ludovic Courtès 2020-12-19tests: Check the mtime and permissions of substituted items....* tests/store.scm ("substitute") ("substitute + build-things with output path") ("substitute + build-things with specific output"): Call 'canonical-file?'. * tests/substitute.scm ("substitute, authorized key"): Check the mtime and permissions of "substitute-retrieved". Ludovic Courtès 2020-12-19tests: Check the build trace for hash mismatches on substitutes....* tests/store.scm ("substitute, corrupt output hash, build trace"): New test. Ludovic Courtès 2020-09-14tests: Remove one 'delete-paths' call in 'tests/store.scm'....This makes the test slightly less expensive. * tests/store.scm ("add-text-to-store vs. delete-paths") ("add-to-store vs. delete-paths"): Delete and merge into... ("add-text-to-store/add-to-store vs. delete-paths"): ... this test. Ludovic Courtès 2020-09-14daemon: Spawn 'guix authenticate' once for all....Previously, we'd spawn 'guix authenticate' once for each item that has to be signed (when exporting) or authenticated (when importing). Now, we spawn it once for all and then follow a request/reply protocol. This reduces the wall-clock time of: guix archive --export -r $(guix build coreutils -d) from 30s to 2s. * guix/scripts/authenticate.scm (sign-with-key): Return the signature instead of displaying it. Raise a &formatted-message instead of calling 'leave'. (validate-signature): Likewise. (read-command): New procedure. (define-enumerate-type, reply-code): New macros. (guix-authenticate)[send-reply]: New procedure. Change to read commands from current-input-port. * nix/libstore/local-store.cc (runAuthenticationProgram): Remove. (authenticationAgent, readInteger, readAuthenticateReply): New functions. (signHash, verifySignature): Rewrite in terms of the agent. * tests/store.scm ("import not signed"): Remove 'pk' call. ("import signed by unauthorized key"): Check the error message of C. * tests/guix-authenticate.sh: Rewrite using the new protocol. fixlet Ludovic Courtès 2020-09-11store: Test 'import-paths' with unauthorized and unsigned nar bundles....* tests/store.scm ("import not signed") ("import signed by unauthorized key"): New tests. Ludovic Courtès 2020-08-28store: 'with-store' returns as many values as its body....Fixes <https://bugs.gnu.org/42912>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in 'call-with-values'. * tests/store.scm ("with-store, multiple values"): New test. Ludovic Courtès