alasql 4.3.4 → 4.3.5

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.3.4
5
+ // Version: 4.3.5
6
6
  // Date: 28.07.2015
7
7
  // (c) 2014-2022, Andrey Gershun & Mathias Wulff
8
8
  //
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.3.4 build: develop-6ecba2e1 | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.3.5 build: develop-6ecba2e1 | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.3.4
4
+ @version 4.3.5
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.3.4 build: develop-6ecba2e1 | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.3.5 build: develop-6ecba2e1 | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.3.4
4
+ @version 4.3.5
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.3.4';
144
+ alasql.version = '4.3.5';
145
145
  alasql.build = 'develop-6ecba2e1';
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 {
@@ -6533,7 +6533,7 @@ function queryfn3(query) {
6533
6533
 
6534
6534
  // Prepare variables
6535
6535
  query.data = [];
6536
- query.xgroups = {};
6536
+ query.xgroups=Object.create(null);
6537
6537
  query.groups = [];
6538
6538
 
6539
6539
  // Level of Joins
@@ -14542,22 +14542,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
14542
14542
  if (this.props && this.props.length > 0) {
14543
14543
  let fs;
14544
14544
  if (this.method === '@') {
14545
- fs = `alasql.vars['${this.variable}']`;
14545
+ fs = `alasql.vars[k('${this.variable}')]`;
14546
14546
  } else {
14547
- fs = `params['${this.variable}']`;
14547
+ fs = `params[k('${this.variable}')]`;
14548
14548
  }
14549
14549
  this.props.forEach(prop => {
14550
14550
  if (typeof prop === 'string') {
14551
- fs += `['${prop}']`;
14551
+ fs += `[k('${prop}')]`;
14552
14552
  } else if (typeof prop === 'number') {
14553
14553
  fs += `[${prop}]`;
14554
14554
  } else {
14555
14555
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
14556
- fs += `[${prop.toJS()}]`;
14556
+ fs += `[k(${prop.toJS()})]`;
14557
14557
  }
14558
14558
  });
14559
14559
 
14560
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
14560
+ new Function('value, params, alasql', `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);
14561
14561
  } else {
14562
14562
  if (this.method === '@') {
14563
14563
  alasql.vars[this.variable] = res;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.3.4 build: develop-6ecba2e1 | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.3.5 build: develop-6ecba2e1 | © 2014-2024 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.3.4
4
+ @version 4.3.5
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.3.4';
144
+ alasql.version = '4.3.5';
145
145
  alasql.build = 'develop-6ecba2e1';
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 {
@@ -6533,7 +6533,7 @@ function queryfn3(query) {
6533
6533
 
6534
6534
  // Prepare variables
6535
6535
  query.data = [];
6536
- query.xgroups = {};
6536
+ query.xgroups=Object.create(null);
6537
6537
  query.groups = [];
6538
6538
 
6539
6539
  // Level of Joins
@@ -14542,22 +14542,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
14542
14542
  if (this.props && this.props.length > 0) {
14543
14543
  let fs;
14544
14544
  if (this.method === '@') {
14545
- fs = `alasql.vars['${this.variable}']`;
14545
+ fs = `alasql.vars[k('${this.variable}')]`;
14546
14546
  } else {
14547
- fs = `params['${this.variable}']`;
14547
+ fs = `params[k('${this.variable}')]`;
14548
14548
  }
14549
14549
  this.props.forEach(prop => {
14550
14550
  if (typeof prop === 'string') {
14551
- fs += `['${prop}']`;
14551
+ fs += `[k('${prop}')]`;
14552
14552
  } else if (typeof prop === 'number') {
14553
14553
  fs += `[${prop}]`;
14554
14554
  } else {
14555
14555
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
14556
- fs += `[${prop.toJS()}]`;
14556
+ fs += `[k(${prop.toJS()})]`;
14557
14557
  }
14558
14558
  });
14559
14559
 
14560
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
14560
+ new Function('value, params, alasql', `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);
14561
14561
  } else {
14562
14562
  if (this.method === '@') {
14563
14563
  alasql.vars[this.variable] = res;