aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/comment.js
blob: 6b5428d4f3a91a2ddcb6866a16c43a15bbaf5c82 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var assert = require("assert");
var uglify = require("../node");

describe("Comment", function() {
    it("Should recognize eol of single line comments", function() {
        var tests = [
            "//Some comment 1\n>",
            "//Some comment 2\r>",
            "//Some comment 3\r\n>",
            "//Some comment 4\u2028>",
            "//Some comment 5\u2029>"
        ];

        var fail = function(e) {
            return e instanceof uglify.JS_Parse_Error &&
                e.message === "Unexpected token: operator (>)" &&
                e.line === 2 &&
                e.col === 0;
        }

        for (var i = 0; i < tests.length; i++) {
            assert.throws(function() {
                uglify.parse(tests[i]);
            }, fail, tests[i]);
        }
    });

    it("Should update the position of a multiline comment correctly", function() {
        var tests = [
            "/*Some comment 1\n\n\n*/\n>\n\n\n\n\n\n",
            "/*Some comment 2\r\n\r\n\r\n*/\r\n>\n\n\n\n\n\n",
            "/*Some comment 3\r\r\r*/\r>\n\n\n\n\n\n",
            "/*Some comment 4\u2028\u2028\u2028*/\u2028>\n\n\n\n\n\n",
            "/*Some comment 5\u2029\u2029\u2029*/\u2029>\n\n\n\n\n\n"
        ];

        var fail = function(e) {
            return e instanceof uglify.JS_Parse_Error &&
                e.message === "Unexpected token: operator (>)" &&
                e.line === 5 &&
                e.col === 0;
        }

        for (var i = 0; i < tests.length; i++) {
            assert.throws(function() {
                uglify.parse(tests[i]);
            }, fail, tests[i]);
        }
    });
});
kages/base.scm?id=6422bde9b4ea4507f794eb61eaca8d402939c2ab'>gnu: glibc: Reinstate fallback code for systems lacking 'prlimit64'....* gnu/packages/patches/glibc-reinstate-prlimit64-fallback.patch: New file. * gnu/packages/base.scm (glibc/linux)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. Ludovic Courtès 2018-03-29gnu: tzdata: Update to 2018d....* gnu/packages/base.scm (tzdata): Update to 2018d. Leo Famulari 2018-03-27gnu: Use invoke and return #t from all builders....* gnu/packages/admin.scm, gnu/packages/android.scm, gnu/packages/audio.scm, gnu/packages/avr.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/certs.scm, gnu/packages/check.scm, gnu/packages/code.scm, gnu/packages/commencement.scm, gnu/packages/dictionaries.scm, gnu/packages/docbook.scm, gnu/packages/emacs.scm, gnu/packages/embedded.scm, gnu/packages/fonts.scm, gnu/packages/games.scm, gnu/packages/gnome.scm, gnu/packages/gnu-doc.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/javascript.scm, gnu/packages/libreoffice.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/pkg-config.scm, gnu/packages/qt.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/sdl.scm, gnu/packages/statistics.scm, gnu/packages/syncthing.scm, gnu/packages/tex.scm, gnu/packages/web.scm, gnu/packages/wine.scm, gnu/packages/xfce.scm: In the builders of packages using 'trivial-build-system', use invoke where appropriate, raise exceptions on errors, and otherwise return #t. Mark H Weaver 2018-03-23gnu: glibc-hurd-headers: Return #t from all phases....* gnu/packages/base.scm (glibc/hurd-headers): Return #t from the custom install phase. Mark H Weaver 2018-03-23gnu: glibc/linux: Return #t from pre-configure phase....* gnu/packages/base.scm (glibc/linux)[arguments]: Return #t from the pre-configure phase. Mark H Weaver 2018-03-22gnu: make: End phase on #t....* gnu/packages/base.scm (gnu-make)[arguments]: Return #t from 'set-default-shell' phase. Marius Bakke 2018-03-22gnu: make: Fix compatibility with glibc 2.27....* gnu/packages/patches/make-glibc-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/base.scm (gnu-make)[source](patches): Use it. Marius Bakke 2018-03-22gnu: glibc: Update to 2.27....* gnu/packages/base.scm (glibc/linux): Update to 2.27. [source](patches): Add 'glibc-hidden-visibility-ldconfig.patch' and 'glibc-2.27-git-fixes.patch'. [native-inputs]: Add BISON. [arguments]: Remove deprecated "--enable-add-ons" from #:configure-flags. Also remove unneeded "libc_cv_ssp=no" and "libcv_ssp_strong=no". (glibc-2.26): New public variable. * gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash)[native-inputs]: Add BISON-BOOT0. * gnu/packages/patches/glibc-2.27-git-fixes.patch, gnu/packages/patches/glibc-hidden-visibility-ldconfig.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. Marius Bakke 2018-03-21gnu: tzdata-for-tests: Update to 2018c....* gnu/packages/base.scm (tzdata-for-tests): Replace with a simple hidden copy of 'tzdata'. Mark H Weaver 2018-03-20Merge branch 'master' into core-updatesMark H Weaver 2018-03-16gnu: glibc: Don't apply upstreamed patch in newer glibc versions....* gnu/packages/base.scm (glibc/linux, glibc-2.25, glibc-2.24, glibc-2.23)[source](patches): Remove 'glibc-o-largefile.patch'. (glibc-2.22)[source](patches): Add it. Marius Bakke 2018-03-16gnu: binutils: Update to 2.30....* gnu/packages/patches/binutils-ld-new-dtags.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/base.scm (binutils): Update to 2.30. [source](patches): Remove obsolete patch. [arguments]: Add "--enable-new-dtags" in #:configure-flags. Marius Bakke 2018-03-16gnu: tar: Fix sparse file detection on Btrfs file systems....* gnu/packages/patches/tar-remove-wholesparse-check.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/base.scm (tar)[source]: Add patch. Mark H Weaver 2018-03-16gnu: All snippets report errors using exceptions, else return #t....* gnu/packages/admin.scm, gnu/packages/algebra.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/cdrom.scm, gnu/packages/chez.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/cross-base.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/fpga.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/geo.scm, gnu/packages/ghostscript.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/graphics.scm, gnu/packages/gtk.scm, gnu/packages/guile.scm, gnu/packages/irc.scm, gnu/packages/java.scm, gnu/packages/kerberos.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t. Mark H Weaver 2018-03-16gnu: tzdata: Use invoke instead of system*....* gnu/packages/base.scm (tzdata)[arguments]: Use invoke. Return a boolean from all phase procedures. Mark H Weaver 2018-03-16gnu: glibc/hurd: Use invoke instead of system*....* gnu/packages/base.scm (glibc/hurd)[arguments]: In the build phase procedure, use 'invoke' instead of 'system*' and remove the vestigial result code plumbing. Change the local macro 'make' into a normal procedure. Mark H Weaver 2018-03-16gnu: glibc-locales: Use invoke instead of system*....* gnu/packages/base.scm (glibc-locales)[arguments]: Use invoke. Mark H Weaver 2018-03-16gnu: glibc-utf8-locales: Use invoke instead of system*....* gnu/packages/base.scm (glibc-utf8-locales)[arguments]: Use invoke and remove the vestigial result code plumbing. Mark H Weaver 2018-03-14gnu: patch: Update to 2.7.6....* gnu/packages/base.scm (patch): Update to 2.7.6. * gnu/packages/patches/patch-hurd-path-max.patch: Adjust to upstream changes. Marius Bakke 2018-03-14gnu: Ungraft glibc....* gnu/packages/base.scm (glibc-2.26-patched): Remove variable. (glibc/linux)[replacement]: Remove. [source]: Add "glibc-allow-kernel-2.6.32.patch" to patches. Ricardo Wurmus 2018-03-14Merge branch 'master' into core-updatesRicardo Wurmus 2018-03-14Revert "gnu: Use patched static bash in glibc replacement."...This reverts commit 42958b5e0feff1000ba17a353bb58fdf45f20716. Ricardo Wurmus 2018-03-14Revert "gnu: Add missing module to (gnu packages base)."...This reverts commit 911e66f922f2316f061656a6edf5f243342735b7. Ricardo Wurmus 2018-03-14gnu: Add missing module to (gnu packages base)....This is a follow-up to commit 42958b5e0feff1000ba17a353bb58fdf45f20716. Reported by pmikkelsen on IRC. * gnu/packages/base.scm: Use srfi-1 for alist-delete. Ricardo Wurmus 2018-03-14gnu: Use patched static bash in glibc replacement....* gnu/packages/base.scm (glibc-2.26-patched): Rename... (glibc-2.26-patched-boot): ...to this. (patched-static-bash, glibc-2.26-patched): New variables. Ricardo Wurmus 2018-03-08Merge branch 'master' into stagingMarius Bakke 2018-03-07gnu: glibc-2.26-patch: Remove unneeded 'replacement' field....* gnu/packages/base.scm (glibc-2.26-patched): Remove unneeded 'replacement' field. Ludovic Courtès 2018-03-06Merge branch 'master' into stagingLeo Famulari 2018-03-01gnu: Graft glibc to allow execution on Linux 2.6.32....* gnu/packages/patches/glibc-allow-kernel-2.6.32.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/base.scm (glibc/linux)[replacement]: New field. (glibc-2.26-patched): New variable. Ricardo Wurmus