alasql 4.15.1 → 4.15.2

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.15.1
5
+ // Version: 4.15.2
6
6
  // Date: 28.07.2015
7
7
  // (c) 2014-2022, Andrey Gershun & Mathias Wulff
8
8
  //
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.15.1 build: develop-3b8d5542 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.15.2 build: develop-3b8d5542 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.15.1
4
+ @version 4.15.2
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 Andrey Gershun & Mathias Wulff
package/dist/alasql.fs.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.15.1 build: develop-3b8d5542 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.15.2 build: develop-3b8d5542 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.15.1
4
+ @version 4.15.2
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 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.15.1';
144
+ alasql.version = '4.15.2';
145
145
  alasql.build = 'develop-3b8d5542';
146
146
 
147
147
  /**
@@ -2948,7 +2948,7 @@ next:function () {
2948
2948
 
2949
2949
  // return next match that has a token
2950
2950
  lex:function lex () {
2951
- var r = this.next();
2951
+ var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
2952
2952
  if (r) {
2953
2953
  return r;
2954
2954
  } else {
@@ -7133,7 +7133,7 @@ function queryfn3(query) {
7133
7133
 
7134
7134
  // Prepare variables
7135
7135
  query.data = [];
7136
- query.xgroups = {};
7136
+ query.xgroups=Object.create(null);
7137
7137
  query.groups = [];
7138
7138
 
7139
7139
  // Level of Joins
@@ -16580,22 +16580,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
16580
16580
  if (this.props && this.props.length > 0) {
16581
16581
  let fs;
16582
16582
  if (this.method === '@') {
16583
- fs = `alasql.vars['${this.variable}']`;
16583
+ fs = `alasql.vars[k('${this.variable}')]`;
16584
16584
  } else {
16585
- fs = `params['${this.variable}']`;
16585
+ fs = `params[k('${this.variable}')]`;
16586
16586
  }
16587
16587
  this.props.forEach(prop => {
16588
16588
  if (typeof prop === 'string') {
16589
- fs += `['${prop}']`;
16589
+ fs += `[k('${prop}')]`;
16590
16590
  } else if (typeof prop === 'number') {
16591
16591
  fs += `[${prop}]`;
16592
16592
  } else {
16593
16593
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
16594
- fs += `[${prop.toJS()}]`;
16594
+ fs += `[k(${prop.toJS()})]`;
16595
16595
  }
16596
16596
  });
16597
16597
 
16598
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
16598
+ 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);
16599
16599
  } else {
16600
16600
  if (this.method === '@') {
16601
16601
  alasql.vars[this.variable] = res;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.15.1 build: develop-3b8d5542 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.15.2 build: develop-3b8d5542 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.15.1
4
+ @version 4.15.2
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 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.15.1';
144
+ alasql.version = '4.15.2';
145
145
  alasql.build = 'develop-3b8d5542';
146
146
 
147
147
  /**
@@ -2948,7 +2948,7 @@ next:function () {
2948
2948
 
2949
2949
  // return next match that has a token
2950
2950
  lex:function lex () {
2951
- var r = this.next();
2951
+ var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
2952
2952
  if (r) {
2953
2953
  return r;
2954
2954
  } else {
@@ -7133,7 +7133,7 @@ function queryfn3(query) {
7133
7133
 
7134
7134
  // Prepare variables
7135
7135
  query.data = [];
7136
- query.xgroups = {};
7136
+ query.xgroups=Object.create(null);
7137
7137
  query.groups = [];
7138
7138
 
7139
7139
  // Level of Joins
@@ -16580,22 +16580,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
16580
16580
  if (this.props && this.props.length > 0) {
16581
16581
  let fs;
16582
16582
  if (this.method === '@') {
16583
- fs = `alasql.vars['${this.variable}']`;
16583
+ fs = `alasql.vars[k('${this.variable}')]`;
16584
16584
  } else {
16585
- fs = `params['${this.variable}']`;
16585
+ fs = `params[k('${this.variable}')]`;
16586
16586
  }
16587
16587
  this.props.forEach(prop => {
16588
16588
  if (typeof prop === 'string') {
16589
- fs += `['${prop}']`;
16589
+ fs += `[k('${prop}')]`;
16590
16590
  } else if (typeof prop === 'number') {
16591
16591
  fs += `[${prop}]`;
16592
16592
  } else {
16593
16593
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
16594
- fs += `[${prop.toJS()}]`;
16594
+ fs += `[k(${prop.toJS()})]`;
16595
16595
  }
16596
16596
  });
16597
16597
 
16598
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
16598
+ 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);
16599
16599
  } else {
16600
16600
  if (this.method === '@') {
16601
16601
  alasql.vars[this.variable] = res;