var assert = require("assert"); var UglifyJS = require("../node"); describe("async", function() { it("Should reject `await` as symbol name within async functions only", function() { [ "function await() {}", "function(await) {}", "function() { await; }", "function() { await:{} }", "function() { var await; }", "function() { function await() {} }", "function() { try {} catch (await) {} }", ].forEach(function(code) { var ast = UglifyJS.parse("(" + code + ")();"); assert.strictEqual(ast.TYPE, "Toplevel"); assert.strictEqual(ast.body.length, 1); assert.strictEqual(ast.body[0].TYPE, "SimpleStatement"); assert.strictEqual(ast.body[0].body.TYPE, "Call"); assert.strictEqual(ast.body[0].body.expression.TYPE, "Function"); assert.throws(function() { UglifyJS.parse("(async " + code + ")();"); }, function(e) { return e instanceof UglifyJS.JS_Parse_Error; }, code); }); }); it("Should reject `await` expression outside of async functions", function() { [ "await 42;", "function f() { await 42; }", "async function f() { function g() { await 42; } }", ].forEach(function(code) { assert.throws(function() { UglifyJS.parse(code); }, function(e) { return e instanceof UglifyJS.JS_Parse_Error; }, code); }); }); it("Should reject `await` expression directly on computed key of function argument", function() { [ "function f({ [await 42]: a }) {}", "async function f({ [await 42]: a }) {}", ].forEach(function(code) { assert.throws(function() { UglifyJS.parse(code); }, function(e) { return e instanceof UglifyJS.JS_Parse_Error; }, code); }); }); it("Should accept `await` expression nested within computed key of function argument", function() { [ "function f({ [async function() { await 42; }()]: a }) {}", "async function f({ [async function() { await 42; }()]: a }) {}", ].forEach(function(code) { var ast = UglifyJS.parse(code); assert.strictEqual(ast.TYPE, "Toplevel"); assert.strictEqual(ast.body.length, 1); assert.strictEqual(ast.body[0].argnames.length, 1); assert.strictEqual(ast.body[0].argnames[0].TYPE, "DestructuredObject"); }); }); }); >Author 2019-02-23gnu: gflags: Don't use NAME in source URI....* gnu/packages/popt.scm (gflags)[source]: Hard-code NAME. Tobias Geerinckx-Rice 2019-02-23gnu: gflags: Update to 2.2.2....* gnu/packages/popt.scm (gflags): Update to 2.2.2. Tobias Geerinckx-Rice .set' to properly handle case where ARG is NULL. Ludovic Courtès 2020-11-29Use substitute servers on the local network....* guix/scripts/discover.scm: New file. * Makefile.am (MODULES): Add it. * nix/nix-daemon/guix-daemon.cc (options): Add "discover" option, (parse-opt): parse it, (main): start "guix discover" process when the option is set. * guix/scripts/substitute.scm (%local-substitute-urls): New variable, (substitute-urls): add it. * gnu/services/base.scm (<guix-configuration>): Add "discover?" field, (guix-shepherd-service): honor it. * doc/guix.texi (Invoking guix-daemon): Document "discover" option, (Base Services): ditto. Mathieu Othacehe 2019-11-26guix build, daemon: Rename "--no-build-hook" to "--no-offload"....This is a followup to bc69ea2d605810cc32e13ed03d5848b8dc358b61. * guix/scripts/build.scm (show-build-options-help): Rename "--no-build-hook" to "--no-offload". (%standard-build-options): Likewise, and warn when "--no-build-hook" is passed. * nix/nix-daemon/guix-daemon.cc (options): Add "--no-offload" and mark "--no-build-hook" as hidden. * guix/scripts/offload.scm: Adjust comment. * doc/guix.texi (Invoking guix-daemon, Common Build Options): Replace "--no-build-hook" with "--no-offload". * etc/completion/fish/guix.fish, etc/completion/zsh/_guix: Adjust accordingly. Ludovic Courtès