alasql 4.16.1 → 4.16.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.16.1
5
+ // Version: 4.16.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.16.1 build: develop-ff717ec7 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.16.2 build: develop-ff717ec7 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.16.1
4
+ @version 4.16.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.16.1 build: develop-ff717ec7 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.16.2 build: develop-ff717ec7 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.16.1
4
+ @version 4.16.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.16.1';
144
+ alasql.version = '4.16.2';
145
145
  alasql.build = 'develop-ff717ec7';
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
@@ -16632,22 +16632,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
16632
16632
  if (this.props && this.props.length > 0) {
16633
16633
  let fs;
16634
16634
  if (this.method === '@') {
16635
- fs = `alasql.vars['${this.variable}']`;
16635
+ fs = `alasql.vars[k('${this.variable}')]`;
16636
16636
  } else {
16637
- fs = `params['${this.variable}']`;
16637
+ fs = `params[k('${this.variable}')]`;
16638
16638
  }
16639
16639
  this.props.forEach(prop => {
16640
16640
  if (typeof prop === 'string') {
16641
- fs += `['${prop}']`;
16641
+ fs += `[k('${prop}')]`;
16642
16642
  } else if (typeof prop === 'number') {
16643
16643
  fs += `[${prop}]`;
16644
16644
  } else {
16645
16645
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
16646
- fs += `[${prop.toJS()}]`;
16646
+ fs += `[k(${prop.toJS()})]`;
16647
16647
  }
16648
16648
  });
16649
16649
 
16650
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
16650
+ 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);
16651
16651
  } else {
16652
16652
  if (this.method === '@') {
16653
16653
  alasql.vars[this.variable] = res;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.16.1 build: develop-ff717ec7 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.16.2 build: develop-ff717ec7 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.16.1
4
+ @version 4.16.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.16.1';
144
+ alasql.version = '4.16.2';
145
145
  alasql.build = 'develop-ff717ec7';
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
@@ -16632,22 +16632,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
16632
16632
  if (this.props && this.props.length > 0) {
16633
16633
  let fs;
16634
16634
  if (this.method === '@') {
16635
- fs = `alasql.vars['${this.variable}']`;
16635
+ fs = `alasql.vars[k('${this.variable}')]`;
16636
16636
  } else {
16637
- fs = `params['${this.variable}']`;
16637
+ fs = `params[k('${this.variable}')]`;
16638
16638
  }
16639
16639
  this.props.forEach(prop => {
16640
16640
  if (typeof prop === 'string') {
16641
- fs += `['${prop}']`;
16641
+ fs += `[k('${prop}')]`;
16642
16642
  } else if (typeof prop === 'number') {
16643
16643
  fs += `[${prop}]`;
16644
16644
  } else {
16645
16645
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
16646
- fs += `[${prop.toJS()}]`;
16646
+ fs += `[k(${prop.toJS()})]`;
16647
16647
  }
16648
16648
  });
16649
16649
 
16650
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
16650
+ 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);
16651
16651
  } else {
16652
16652
  if (this.method === '@') {
16653
16653
  alasql.vars[this.variable] = res;