var assert = require("assert"); var UglifyJS = require("../node"); describe("Getters and setters", function() { it("Should not accept operator symbols as getter/setter name", function() { [ "++", "--", "+", "-", "!", "~", "&", "|", "^", "*", "/", "%", ">>", "<<", ">>>", "<", ">", "<=", ">=", "==", "===", "!=", "!==", "?", "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=", "&&", "||" ].reduce(function(tests, illegalOperator) { tests.push({ code: "var obj = { get " + illegalOperator + "() { return test; }};", operator: illegalOperator, }); tests.push({ code: "var obj = { set " + illegalOperator + "(value) { test = value; }};", operator: illegalOperator, }); return tests; }, []).forEach(function(test) { assert.throws(function() { UglifyJS.parse(test.code); }, test.operator == "=" ? function(e) { return e instanceof UglifyJS.JS_Parse_Error && /^Unexpected token: punc «{», expected: punc «.*?»$/.test(e.message); } : function(e) { return e instanceof UglifyJS.JS_Parse_Error && e.message === "Unexpected token: operator «" + test.operator + "»"; }, "Expected but didn't get a syntax error while parsing following line:\n" + test.code); }); }); }); tem/vm.scm?showmsg=1'>Expand)Author 2024-04-17vm: Always use a native emulator in ‘guix system vm’....Ludovic Courtès 2024-03-31vm: If not the same local architecture, don't enable kvm....Zheng Junjie 2024-03-31vm: add arguments to use virt machine type for qemu-riscv64....Zheng Junjie 2024-03-31vm: When target riscv64-linux, use u-boot-qemu-riscv64-bootloader....Zheng Junjie 2024-03-31vm: use #$ for kernel-arguments....Zheng Junjie 2024-02-10services: Add ‘virtual-build-machine’ service....Ludovic Courtès 2024-02-10vm: Add ‘cpu-count’ field to <virtual-machine>....Ludovic Courtès 2024-02-10vm: Export <virtual-machine> accessors....Ludovic Courtès 2024-02-10vm: Add ‘date’ field to <virtual-machine>....Ludovic Courtès 2023-10-29system: vm: Include the cirrus driver in the initrd....Tobias Geerinckx-Rice 2023-10-01system: vm: Remove unused variable....Ludovic Courtès