alasql 4.1.12 → 4.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/alasql-cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  //
4
4
  // Command line interface for Alasql
5
- // Version: 4.1.12
5
+ // Version: 4.1.13
6
6
  // Date: 28.07.2015
7
7
  // (c) 2014-2022, Andrey Gershun & Mathias Wulff
8
8
  //
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.1.12 build: develop-1493d57a | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.1.13 build: develop-1493d57a | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.1.12
4
+ @version 4.1.13
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2023 Andrey Gershun & Mathias Wulff
package/dist/alasql.fs.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.1.12 build: develop-1493d57a | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.1.13 build: develop-1493d57a | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.1.12
4
+ @version 4.1.13
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2023 Andrey Gershun & Mathias Wulff
@@ -141,7 +141,7 @@ var alasql = function(sql, params, cb, scope) {
141
141
  Current version of alasql
142
142
  @constant {string}
143
143
  */
144
- alasql.version = '4.1.12';
144
+ alasql.version = '4.1.13';
145
145
  alasql.build = 'develop-1493d57a';
146
146
 
147
147
  /**
@@ -2497,7 +2497,7 @@ next:function () {
2497
2497
 
2498
2498
  // return next match that has a token
2499
2499
  lex:function lex () {
2500
- var r = this.next();
2500
+ var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
2501
2501
  if (r) {
2502
2502
  return r;
2503
2503
  } else {
@@ -6548,7 +6548,7 @@ function queryfn3(query) {
6548
6548
 
6549
6549
  // Prepare variables
6550
6550
  query.data = [];
6551
- query.xgroups = {};
6551
+ query.xgroups=Object.create(null);
6552
6552
  query.groups = [];
6553
6553
 
6554
6554
  // Level of Joins
@@ -15337,19 +15337,19 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15337
15337
  }
15338
15338
  if (this.props && this.props.length > 0) {
15339
15339
  if (this.method == '@') {
15340
- var fs = "alasql.vars['" + this.variable + "']";
15340
+ var fs = "alasql.vars[k('"+this.variable+"')]";
15341
15341
  } else {
15342
- var fs = "params['" + this.variable + "']";
15342
+ var fs = "params[k('"+this.variable+"')]";
15343
15343
  }
15344
15344
  fs += this.props
15345
15345
  .map(function (prop) {
15346
15346
  if (typeof prop == 'string') {
15347
- return "['" + prop + "']";
15347
+ return "[k('"+prop+"')]";
15348
15348
  } else if (typeof prop == 'number') {
15349
15349
  return '[' + prop + ']';
15350
15350
  } else {
15351
15351
 
15352
- return '[' + prop.toJS() + ']';
15352
+ return "[k("+prop.toJS()+")]";
15353
15353
  // } else {
15354
15354
 
15355
15355
  // throw new Error('Wrong SET property');
@@ -15357,7 +15357,7 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15357
15357
  })
15358
15358
  .join();
15359
15359
 
15360
- new Function('value,params,alasql', 'var y;' + fs + '=value')(res, params, alasql);
15360
+ new Function('value,params,alasql', 'var y;var k=function(x){if(x==="__proto__"||x==="constructor"||x==="prototype")throw new Error(x+" is not allowed");return x};'+fs+'=value')(res, params, alasql);
15361
15361
  } else {
15362
15362
  if (this.method == '@') {
15363
15363
  alasql.vars[this.variable] = res;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.1.12 build: develop-1493d57a | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.1.13 build: develop-1493d57a | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.1.12
4
+ @version 4.1.13
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2023 Andrey Gershun & Mathias Wulff
@@ -141,7 +141,7 @@ var alasql = function(sql, params, cb, scope) {
141
141
  Current version of alasql
142
142
  @constant {string}
143
143
  */
144
- alasql.version = '4.1.12';
144
+ alasql.version = '4.1.13';
145
145
  alasql.build = 'develop-1493d57a';
146
146
 
147
147
  /**
@@ -2497,7 +2497,7 @@ next:function () {
2497
2497
 
2498
2498
  // return next match that has a token
2499
2499
  lex:function lex () {
2500
- var r = this.next();
2500
+ var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
2501
2501
  if (r) {
2502
2502
  return r;
2503
2503
  } else {
@@ -6548,7 +6548,7 @@ function queryfn3(query) {
6548
6548
 
6549
6549
  // Prepare variables
6550
6550
  query.data = [];
6551
- query.xgroups = {};
6551
+ query.xgroups=Object.create(null);
6552
6552
  query.groups = [];
6553
6553
 
6554
6554
  // Level of Joins
@@ -15337,19 +15337,19 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15337
15337
  }
15338
15338
  if (this.props && this.props.length > 0) {
15339
15339
  if (this.method == '@') {
15340
- var fs = "alasql.vars['" + this.variable + "']";
15340
+ var fs = "alasql.vars[k('"+this.variable+"')]";
15341
15341
  } else {
15342
- var fs = "params['" + this.variable + "']";
15342
+ var fs = "params[k('"+this.variable+"')]";
15343
15343
  }
15344
15344
  fs += this.props
15345
15345
  .map(function (prop) {
15346
15346
  if (typeof prop == 'string') {
15347
- return "['" + prop + "']";
15347
+ return "[k('"+prop+"')]";
15348
15348
  } else if (typeof prop == 'number') {
15349
15349
  return '[' + prop + ']';
15350
15350
  } else {
15351
15351
 
15352
- return '[' + prop.toJS() + ']';
15352
+ return "[k("+prop.toJS()+")]";
15353
15353
  // } else {
15354
15354
 
15355
15355
  // throw new Error('Wrong SET property');
@@ -15357,7 +15357,7 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15357
15357
  })
15358
15358
  .join();
15359
15359
 
15360
- new Function('value,params,alasql', 'var y;' + fs + '=value')(res, params, alasql);
15360
+ new Function('value,params,alasql', 'var y;var k=function(x){if(x==="__proto__"||x==="constructor"||x==="prototype")throw new Error(x+" is not allowed");return x};'+fs+'=value')(res, params, alasql);
15361
15361
  } else {
15362
15362
  if (this.method == '@') {
15363
15363
  alasql.vars[this.variable] = res;