mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
374 stars 91 forks source link

globalThis in lib/misc/utils.js #149

Closed mnpenner closed 3 years ago

mnpenner commented 3 years ago

Rollup.js is spitting out this error when I packaging mariadb:

(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/mariadb/lib/misc/utils.js
149:         for (let i = 0; i < value.length; i++) {
150:           if (i !== 0) out += ',';
151:           out += this.escape(opts, info, value[i]);
                      ^
152:         }
153:         if (opts.arrayParenthesis) out += ')';

Line is here: https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/c70948f43fbaeeb7fc79c0332f0f48a8f557bb23/lib/misc/utils.js#L151

I can work around this, but you might consider changing this to globalThis or global.

rusher commented 3 years ago

allright. This will be corrected in next version