Bug#926871: [Pkg-javascript-devel] Bug#926871: Uncaught SyntaxError: Unexpected token export

2019-04-11 Thread Jérémy Lal
Le jeu. 11 avr. 2019 à 17:24, Enrico Zini  a écrit :

> Package: libjs-popper.js
> Version: 1.14.6+ds2-1
> Severity: important
>
> Hello,
>
> these toplevel scripts:
>
> /usr/share/javascript/popper.js/popper.js
> /usr/share/javascript/popper.js/popper.min.js
>
> contain an export definition that doesn't seem to be standard
> JavaScript:
>
> $ tail /usr/share/javascript/popper.js/popper.js
> …
> export default Popper;
>
> and indeed, using them in a browser raises an exception:
>
> Uncaught SyntaxError: Unexpected token export
>
> Using the umd/ versions work:
>
> /usr/share/javascript/popper.js/umd/popper.js
> /usr/share/javascript/popper.js/umd/popper.min.js
>
> I find this to be surprising behaviour, as I'd expect the toplevel
> versions to be valid JavaScript, and other fancy things to be in
> subdirectories, but I'm happy to stand corrected.
>

The top level files should indeed be removed, leaving just the two
directories
- esm stands for "es6 modules" which are the future format, very cool,
though as far as i know is not supported anywhere without some explicit
experimental flag.
- umd stands for "universal modules" and works everywhere

 Jérémy


Bug#926871: Uncaught SyntaxError: Unexpected token export

2019-04-11 Thread Enrico Zini
Package: libjs-popper.js
Version: 1.14.6+ds2-1
Severity: important

Hello,

these toplevel scripts:

/usr/share/javascript/popper.js/popper.js
/usr/share/javascript/popper.js/popper.min.js

contain an export definition that doesn't seem to be standard
JavaScript:

$ tail /usr/share/javascript/popper.js/popper.js
…
export default Popper;

and indeed, using them in a browser raises an exception:

Uncaught SyntaxError: Unexpected token export

Using the umd/ versions work:

/usr/share/javascript/popper.js/umd/popper.js
/usr/share/javascript/popper.js/umd/popper.min.js

I find this to be surprising behaviour, as I'd expect the toplevel
versions to be valid JavaScript, and other fancy things to be in
subdirectories, but I'm happy to stand corrected.


Enrico


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-4-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_IE:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libjs-popper.js depends on:
ii  javascript-common  11

Versions of packages libjs-popper.js recommends:
pn  node-jquery  

libjs-popper.js suggests no packages.

-- no debconf information