alasql 4.2.8 → 4.2.9

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.2.8
5
+ // Version: 4.2.9
6
6
  // Date: 28.07.2015
7
7
  // (c) 2014-2022, Andrey Gershun & Mathias Wulff
8
8
  //
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.2.8 build: develop-6db74fcc | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.2.9 build: develop-6db74fcc | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.2.8
4
+ @version 4.2.9
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2024 Andrey Gershun & Mathias Wulff
package/dist/alasql.fs.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.2.8 build: develop-6db74fcc | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.2.9 build: develop-6db74fcc | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.2.8
4
+ @version 4.2.9
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2024 Andrey Gershun & Mathias Wulff
@@ -141,7 +141,7 @@ SOFTWARE.
141
141
  Current version of alasql
142
142
  @constant {string}
143
143
  */
144
- alasql.version = '4.2.8';
144
+ alasql.version = '4.2.9';
145
145
  alasql.build = 'develop-6db74fcc';
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 {
@@ -6559,7 +6559,7 @@ function queryfn3(query) {
6559
6559
 
6560
6560
  // Prepare variables
6561
6561
  query.data = [];
6562
- query.xgroups = {};
6562
+ query.xgroups=Object.create(null);
6563
6563
  query.groups = [];
6564
6564
 
6565
6565
  // Level of Joins
@@ -15215,19 +15215,19 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15215
15215
  }
15216
15216
  if (this.props && this.props.length > 0) {
15217
15217
  if (this.method == '@') {
15218
- var fs = "alasql.vars['" + this.variable + "']";
15218
+ var fs = "alasql.vars[k('"+this.variable+"')]";
15219
15219
  } else {
15220
- var fs = "params['" + this.variable + "']";
15220
+ var fs = "params[k('"+this.variable+"')]";
15221
15221
  }
15222
15222
  fs += this.props
15223
15223
  .map(function (prop) {
15224
15224
  if (typeof prop == 'string') {
15225
- return "['" + prop + "']";
15225
+ return "[k('"+prop+"')]";
15226
15226
  } else if (typeof prop == 'number') {
15227
15227
  return '[' + prop + ']';
15228
15228
  } else {
15229
15229
 
15230
- return '[' + prop.toJS() + ']';
15230
+ return "[k("+prop.toJS()+")]";
15231
15231
  // } else {
15232
15232
 
15233
15233
  // throw new Error('Wrong SET property');
@@ -15235,7 +15235,7 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15235
15235
  })
15236
15236
  .join();
15237
15237
 
15238
- new Function('value,params,alasql', 'var y;' + fs + '=value')(res, params, alasql);
15238
+ 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);
15239
15239
  } else {
15240
15240
  if (this.method == '@') {
15241
15241
  alasql.vars[this.variable] = res;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.2.8 build: develop-6db74fcc | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.2.9 build: develop-6db74fcc | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.2.8
4
+ @version 4.2.9
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2024 Andrey Gershun & Mathias Wulff
@@ -141,7 +141,7 @@ SOFTWARE.
141
141
  Current version of alasql
142
142
  @constant {string}
143
143
  */
144
- alasql.version = '4.2.8';
144
+ alasql.version = '4.2.9';
145
145
  alasql.build = 'develop-6db74fcc';
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 {
@@ -6559,7 +6559,7 @@ function queryfn3(query) {
6559
6559
 
6560
6560
  // Prepare variables
6561
6561
  query.data = [];
6562
- query.xgroups = {};
6562
+ query.xgroups=Object.create(null);
6563
6563
  query.groups = [];
6564
6564
 
6565
6565
  // Level of Joins
@@ -15215,19 +15215,19 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15215
15215
  }
15216
15216
  if (this.props && this.props.length > 0) {
15217
15217
  if (this.method == '@') {
15218
- var fs = "alasql.vars['" + this.variable + "']";
15218
+ var fs = "alasql.vars[k('"+this.variable+"')]";
15219
15219
  } else {
15220
- var fs = "params['" + this.variable + "']";
15220
+ var fs = "params[k('"+this.variable+"')]";
15221
15221
  }
15222
15222
  fs += this.props
15223
15223
  .map(function (prop) {
15224
15224
  if (typeof prop == 'string') {
15225
- return "['" + prop + "']";
15225
+ return "[k('"+prop+"')]";
15226
15226
  } else if (typeof prop == 'number') {
15227
15227
  return '[' + prop + ']';
15228
15228
  } else {
15229
15229
 
15230
- return '[' + prop.toJS() + ']';
15230
+ return "[k("+prop.toJS()+")]";
15231
15231
  // } else {
15232
15232
 
15233
15233
  // throw new Error('Wrong SET property');
@@ -15235,7 +15235,7 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
15235
15235
  })
15236
15236
  .join();
15237
15237
 
15238
- new Function('value,params,alasql', 'var y;' + fs + '=value')(res, params, alasql);
15238
+ 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);
15239
15239
  } else {
15240
15240
  if (this.method == '@') {
15241
15241
  alasql.vars[this.variable] = res;