alasql 4.21.0 → 4.21.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 +1 -1
- package/dist/alasql-worker.js +2 -2
- package/dist/alasql.fs.js +27 -27
- package/dist/alasql.js +27 -27
- package/dist/alasql.min.js +29 -29
- package/package.json +1 -1
package/bin/alasql-cli.js
CHANGED
package/dist/alasql-worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.21.
|
|
1
|
+
//! AlaSQL v4.21.2 build: develop-38bf3c39 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.21.
|
|
4
|
+
@version 4.21.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.21.
|
|
1
|
+
//! AlaSQL v4.21.2 build: develop-38bf3c39 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.21.
|
|
4
|
+
@version 4.21.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.21.
|
|
144
|
+
alasql.version = '4.21.2';
|
|
145
145
|
alasql.build = 'develop-38bf3c39';
|
|
146
146
|
|
|
147
147
|
/**
|
|
@@ -3052,7 +3052,7 @@ next:function () {
|
|
|
3052
3052
|
|
|
3053
3053
|
// return next match that has a token
|
|
3054
3054
|
lex:function lex () {
|
|
3055
|
-
var r = this.next();
|
|
3055
|
+
var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
|
|
3056
3056
|
if (r) {
|
|
3057
3057
|
return r;
|
|
3058
3058
|
} else {
|
|
@@ -4632,11 +4632,11 @@ var cloneDeep = (utils.cloneDeep = function cloneDeep(obj) {
|
|
|
4632
4632
|
return +obj;
|
|
4633
4633
|
}
|
|
4634
4634
|
|
|
4635
|
-
var temp = new obj.constructor(); // changed
|
|
4635
|
+
var temp = new (Object.prototype.hasOwnProperty.call(obj, 'constructor') ? Object : obj.constructor)(); // changed
|
|
4636
4636
|
|
|
4637
4637
|
for (var key in obj) {
|
|
4638
4638
|
if (obj.hasOwnProperty(key)) {
|
|
4639
|
-
temp[key] = cloneDeep(obj[key]);
|
|
4639
|
+
/* A "__proto__" key from parsed data is copied as data, never as the prototype */ if (key === '__proto__') { Object.defineProperty(temp, key, {value: cloneDeep(obj[key]), writable: true, enumerable: true, configurable: true}); } else { temp[key] = cloneDeep(obj[key]); }
|
|
4640
4640
|
}
|
|
4641
4641
|
}
|
|
4642
4642
|
return temp;
|
|
@@ -4708,7 +4708,7 @@ var extend = (utils.extend = function extend(a, b) {
|
|
|
4708
4708
|
a = a || {};
|
|
4709
4709
|
for (var key in b) {
|
|
4710
4710
|
if (b.hasOwnProperty(key)) {
|
|
4711
|
-
a[key] = b[key];
|
|
4711
|
+
/* A "__proto__" key from parsed data is copied as data, never as the prototype */ if (key === '__proto__') { Object.defineProperty(a, key, {value: b[key], writable: true, enumerable: true, configurable: true}); } else { a[key] = b[key]; }
|
|
4712
4712
|
}
|
|
4713
4713
|
}
|
|
4714
4714
|
return a;
|
|
@@ -7383,7 +7383,7 @@ function queryfn3(query) {
|
|
|
7383
7383
|
|
|
7384
7384
|
// Prepare variables
|
|
7385
7385
|
query.data = [];
|
|
7386
|
-
query.xgroups
|
|
7386
|
+
query.xgroups=Object.create(null);
|
|
7387
7387
|
query.groups = [];
|
|
7388
7388
|
|
|
7389
7389
|
// Level of Joins
|
|
@@ -8472,7 +8472,7 @@ yy.Select = class Select {
|
|
|
8472
8472
|
var converted = {};
|
|
8473
8473
|
for (var key in r) {
|
|
8474
8474
|
var colDef = table.xcolumns && table.xcolumns[key];
|
|
8475
|
-
|
|
8475
|
+
var cv=alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);if(key==="__proto__"){Object.defineProperty(converted,key,{value:cv,writable:true,enumerable:true,configurable:true})}else{converted[key]=cv}
|
|
8476
8476
|
}
|
|
8477
8477
|
table.data.push(converted);
|
|
8478
8478
|
`;
|
|
@@ -9815,7 +9815,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
9815
9815
|
aft2 = '';
|
|
9816
9816
|
|
|
9817
9817
|
if (typeof query.groupStar !== 'undefined') {
|
|
9818
|
-
aft2 += "for(var f in p['" + query.groupStar + "']) {g[f]=p['" + query.groupStar + "'][f];};";
|
|
9818
|
+
aft2 += "for(var f in p['" + query.groupStar + "']) {if(/^__proto__$/.test(f))Object.defineProperty(g,f,{writable:true,enumerable:true,configurable:true});g[f]=p['" + query.groupStar + "'][f];};";
|
|
9819
9819
|
}
|
|
9820
9820
|
|
|
9821
9821
|
s += query.selectGroup
|
|
@@ -10299,7 +10299,7 @@ function compileSelectStar(query, aliases, joinstar) {
|
|
|
10299
10299
|
'var w=p["' + escapeq(alias) + '"];for(var k in w){r["' + escapeq(alias) + '_"+k]=w[k]};';
|
|
10300
10300
|
} else {
|
|
10301
10301
|
// Default overwrite mode
|
|
10302
|
-
sp += 'var w=p["' + escapeq(alias) + '"];for(var k in w){r[k]=w[k]};';
|
|
10302
|
+
sp += 'var w=p["' + escapeq(alias) + '"];for(var k in w){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=w[k]};';
|
|
10303
10303
|
}
|
|
10304
10304
|
|
|
10305
10305
|
query.dirtyColumns = true;
|
|
@@ -10779,10 +10779,10 @@ yy.Select.prototype.compileSelectGroup1 = function (query) {
|
|
|
10779
10779
|
self.columns.forEach(function (col) {
|
|
10780
10780
|
|
|
10781
10781
|
if (col instanceof yy.Column && col.columnid === '*') {
|
|
10782
|
-
// s += 'for(var k in g){r[k]=g[k]};';
|
|
10782
|
+
// s += 'for(var k in g){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10783
10783
|
// s += 'for(var k in this.query.groupColumns){r[k]=g[this.query.groupColumns[k]]};';
|
|
10784
10784
|
|
|
10785
|
-
s += 'for(var k in g) {r[k]=g[k]};';
|
|
10785
|
+
s += 'for(var k in g) {if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10786
10786
|
return '';
|
|
10787
10787
|
|
|
10788
10788
|
} else {
|
|
@@ -12143,7 +12143,7 @@ yy.Over = class Over {
|
|
|
12143
12143
|
const allValues = this.right.map(value => value.value);
|
|
12144
12144
|
const allValuesStr = allValues.join(',');
|
|
12145
12145
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
12146
|
-
s = `alasql.sets[
|
|
12146
|
+
s = `alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
12147
12147
|
}
|
|
12148
12148
|
} else {
|
|
12149
12149
|
s = `(${rightJS()}.indexOf(${leftJS()}) > -1)`;
|
|
@@ -12177,7 +12177,7 @@ yy.Over = class Over {
|
|
|
12177
12177
|
const allValues = this.right.map(value => value.value);
|
|
12178
12178
|
const allValuesStr = allValues.join(',');
|
|
12179
12179
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
12180
|
-
s = `!alasql.sets[
|
|
12180
|
+
s = `!alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
12181
12181
|
}
|
|
12182
12182
|
} else {
|
|
12183
12183
|
s = `(${rightJS()}.indexOf(${leftJS()}) === -1)`;
|
|
@@ -14330,7 +14330,7 @@ yy.CreateTable.prototype.execute = function (databaseid, params, cb) {
|
|
|
14330
14330
|
|
|
14331
14331
|
table.update(
|
|
14332
14332
|
function (t) {
|
|
14333
|
-
for (var f in r) t[f] = r[f];
|
|
14333
|
+
for (var f in r) {if(/^__proto__$/.test(f))Object.defineProperty(t,f,{writable:true,enumerable:true,configurable:true});t[f] = r[f];}
|
|
14334
14334
|
},
|
|
14335
14335
|
table.data.indexOf(toreplace),
|
|
14336
14336
|
params
|
|
@@ -16162,7 +16162,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
16162
16162
|
});
|
|
16163
16163
|
} else {
|
|
16164
16164
|
|
|
16165
|
-
// sw = 'var w='+JSONtoJS(values)+';for(var k in w){r[k]=w[k]};';
|
|
16165
|
+
// sw = 'var w='+JSONtoJS(values)+';for(var k in w){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=w[k]};';
|
|
16166
16166
|
sw = JSONtoJS(values);
|
|
16167
16167
|
}
|
|
16168
16168
|
}
|
|
@@ -16241,7 +16241,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
16241
16241
|
self.output.columns.forEach(function (col) {
|
|
16242
16242
|
if (col.columnid === '*') {
|
|
16243
16243
|
// For *, expand all properties
|
|
16244
|
-
s += 'for(var key in r){ outputRow[key] = r[key]; }';
|
|
16244
|
+
s += 'for(var key in r){ if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key]; }';
|
|
16245
16245
|
} else {
|
|
16246
16246
|
var colname = col.as || col.columnid;
|
|
16247
16247
|
// Direct property access for simple columns
|
|
@@ -16320,7 +16320,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
16320
16320
|
if (col.columnid === '*') {
|
|
16321
16321
|
// For *, expand all properties
|
|
16322
16322
|
for (var key in r) {
|
|
16323
|
-
outputRow[key] = r[key];
|
|
16323
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16324
16324
|
}
|
|
16325
16325
|
} else {
|
|
16326
16326
|
var colname = col.as || col.columnid;
|
|
@@ -16672,7 +16672,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16672
16672
|
if (col.columnid === '*') {
|
|
16673
16673
|
// For *, expand all properties
|
|
16674
16674
|
for (var key in r) {
|
|
16675
|
-
outputRow[key] = r[key];
|
|
16675
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16676
16676
|
}
|
|
16677
16677
|
} else {
|
|
16678
16678
|
var colname = col.as || col.columnid;
|
|
@@ -16743,7 +16743,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16743
16743
|
if (col.columnid === '*') {
|
|
16744
16744
|
// For *, expand all properties
|
|
16745
16745
|
for (var key in r) {
|
|
16746
|
-
outputRow[key] = r[key];
|
|
16746
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16747
16747
|
}
|
|
16748
16748
|
} else {
|
|
16749
16749
|
var colname = col.as || col.columnid;
|
|
@@ -16914,7 +16914,7 @@ yy.Update.prototype.compile = function (databaseid) {
|
|
|
16914
16914
|
if (col.columnid === '*') {
|
|
16915
16915
|
// For *, use INSERTED values
|
|
16916
16916
|
for (var key in inserted) {
|
|
16917
|
-
outputRow[key] = inserted[key];
|
|
16917
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = inserted[key];
|
|
16918
16918
|
}
|
|
16919
16919
|
} else {
|
|
16920
16920
|
var colname = col.as || col.columnid;
|
|
@@ -17481,22 +17481,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
|
|
|
17481
17481
|
if (this.props && this.props.length > 0) {
|
|
17482
17482
|
let fs;
|
|
17483
17483
|
if (this.method === '@') {
|
|
17484
|
-
fs = `alasql.vars['${this.variable}']`;
|
|
17484
|
+
fs = `alasql.vars[k('${this.variable}')]`;
|
|
17485
17485
|
} else {
|
|
17486
|
-
fs = `params['${this.variable}']`;
|
|
17486
|
+
fs = `params[k('${this.variable}')]`;
|
|
17487
17487
|
}
|
|
17488
17488
|
this.props.forEach(prop => {
|
|
17489
17489
|
if (typeof prop === 'string') {
|
|
17490
|
-
fs += `['${prop}']`;
|
|
17490
|
+
fs += `[k('${prop}')]`;
|
|
17491
17491
|
} else if (typeof prop === 'number') {
|
|
17492
17492
|
fs += `[${prop}]`;
|
|
17493
17493
|
} else {
|
|
17494
17494
|
// Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
|
|
17495
|
-
fs += `[${prop.toJS()}]`;
|
|
17495
|
+
fs += `[k(${prop.toJS()})]`;
|
|
17496
17496
|
}
|
|
17497
17497
|
});
|
|
17498
17498
|
|
|
17499
|
-
new Function('value, params, alasql',
|
|
17499
|
+
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);
|
|
17500
17500
|
} else {
|
|
17501
17501
|
if (this.method === '@') {
|
|
17502
17502
|
alasql.vars[this.variable] = res;
|
package/dist/alasql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.21.
|
|
1
|
+
//! AlaSQL v4.21.2 build: develop-38bf3c39 | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.21.
|
|
4
|
+
@version 4.21.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.21.
|
|
144
|
+
alasql.version = '4.21.2';
|
|
145
145
|
alasql.build = 'develop-38bf3c39';
|
|
146
146
|
|
|
147
147
|
/**
|
|
@@ -3052,7 +3052,7 @@ next:function () {
|
|
|
3052
3052
|
|
|
3053
3053
|
// return next match that has a token
|
|
3054
3054
|
lex:function lex () {
|
|
3055
|
-
var r = this.next();
|
|
3055
|
+
var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
|
|
3056
3056
|
if (r) {
|
|
3057
3057
|
return r;
|
|
3058
3058
|
} else {
|
|
@@ -4632,11 +4632,11 @@ var cloneDeep = (utils.cloneDeep = function cloneDeep(obj) {
|
|
|
4632
4632
|
return +obj;
|
|
4633
4633
|
}
|
|
4634
4634
|
|
|
4635
|
-
var temp = new obj.constructor(); // changed
|
|
4635
|
+
var temp = new (Object.prototype.hasOwnProperty.call(obj, 'constructor') ? Object : obj.constructor)(); // changed
|
|
4636
4636
|
|
|
4637
4637
|
for (var key in obj) {
|
|
4638
4638
|
if (obj.hasOwnProperty(key)) {
|
|
4639
|
-
temp[key] = cloneDeep(obj[key]);
|
|
4639
|
+
/* A "__proto__" key from parsed data is copied as data, never as the prototype */ if (key === '__proto__') { Object.defineProperty(temp, key, {value: cloneDeep(obj[key]), writable: true, enumerable: true, configurable: true}); } else { temp[key] = cloneDeep(obj[key]); }
|
|
4640
4640
|
}
|
|
4641
4641
|
}
|
|
4642
4642
|
return temp;
|
|
@@ -4708,7 +4708,7 @@ var extend = (utils.extend = function extend(a, b) {
|
|
|
4708
4708
|
a = a || {};
|
|
4709
4709
|
for (var key in b) {
|
|
4710
4710
|
if (b.hasOwnProperty(key)) {
|
|
4711
|
-
a[key] = b[key];
|
|
4711
|
+
/* A "__proto__" key from parsed data is copied as data, never as the prototype */ if (key === '__proto__') { Object.defineProperty(a, key, {value: b[key], writable: true, enumerable: true, configurable: true}); } else { a[key] = b[key]; }
|
|
4712
4712
|
}
|
|
4713
4713
|
}
|
|
4714
4714
|
return a;
|
|
@@ -7383,7 +7383,7 @@ function queryfn3(query) {
|
|
|
7383
7383
|
|
|
7384
7384
|
// Prepare variables
|
|
7385
7385
|
query.data = [];
|
|
7386
|
-
query.xgroups
|
|
7386
|
+
query.xgroups=Object.create(null);
|
|
7387
7387
|
query.groups = [];
|
|
7388
7388
|
|
|
7389
7389
|
// Level of Joins
|
|
@@ -8472,7 +8472,7 @@ yy.Select = class Select {
|
|
|
8472
8472
|
var converted = {};
|
|
8473
8473
|
for (var key in r) {
|
|
8474
8474
|
var colDef = table.xcolumns && table.xcolumns[key];
|
|
8475
|
-
|
|
8475
|
+
var cv=alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);if(key==="__proto__"){Object.defineProperty(converted,key,{value:cv,writable:true,enumerable:true,configurable:true})}else{converted[key]=cv}
|
|
8476
8476
|
}
|
|
8477
8477
|
table.data.push(converted);
|
|
8478
8478
|
`;
|
|
@@ -9815,7 +9815,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
9815
9815
|
aft2 = '';
|
|
9816
9816
|
|
|
9817
9817
|
if (typeof query.groupStar !== 'undefined') {
|
|
9818
|
-
aft2 += "for(var f in p['" + query.groupStar + "']) {g[f]=p['" + query.groupStar + "'][f];};";
|
|
9818
|
+
aft2 += "for(var f in p['" + query.groupStar + "']) {if(/^__proto__$/.test(f))Object.defineProperty(g,f,{writable:true,enumerable:true,configurable:true});g[f]=p['" + query.groupStar + "'][f];};";
|
|
9819
9819
|
}
|
|
9820
9820
|
|
|
9821
9821
|
s += query.selectGroup
|
|
@@ -10299,7 +10299,7 @@ function compileSelectStar(query, aliases, joinstar) {
|
|
|
10299
10299
|
'var w=p["' + escapeq(alias) + '"];for(var k in w){r["' + escapeq(alias) + '_"+k]=w[k]};';
|
|
10300
10300
|
} else {
|
|
10301
10301
|
// Default overwrite mode
|
|
10302
|
-
sp += 'var w=p["' + escapeq(alias) + '"];for(var k in w){r[k]=w[k]};';
|
|
10302
|
+
sp += 'var w=p["' + escapeq(alias) + '"];for(var k in w){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=w[k]};';
|
|
10303
10303
|
}
|
|
10304
10304
|
|
|
10305
10305
|
query.dirtyColumns = true;
|
|
@@ -10779,10 +10779,10 @@ yy.Select.prototype.compileSelectGroup1 = function (query) {
|
|
|
10779
10779
|
self.columns.forEach(function (col) {
|
|
10780
10780
|
|
|
10781
10781
|
if (col instanceof yy.Column && col.columnid === '*') {
|
|
10782
|
-
// s += 'for(var k in g){r[k]=g[k]};';
|
|
10782
|
+
// s += 'for(var k in g){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10783
10783
|
// s += 'for(var k in this.query.groupColumns){r[k]=g[this.query.groupColumns[k]]};';
|
|
10784
10784
|
|
|
10785
|
-
s += 'for(var k in g) {r[k]=g[k]};';
|
|
10785
|
+
s += 'for(var k in g) {if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10786
10786
|
return '';
|
|
10787
10787
|
|
|
10788
10788
|
} else {
|
|
@@ -12143,7 +12143,7 @@ yy.Over = class Over {
|
|
|
12143
12143
|
const allValues = this.right.map(value => value.value);
|
|
12144
12144
|
const allValuesStr = allValues.join(',');
|
|
12145
12145
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
12146
|
-
s = `alasql.sets[
|
|
12146
|
+
s = `alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
12147
12147
|
}
|
|
12148
12148
|
} else {
|
|
12149
12149
|
s = `(${rightJS()}.indexOf(${leftJS()}) > -1)`;
|
|
@@ -12177,7 +12177,7 @@ yy.Over = class Over {
|
|
|
12177
12177
|
const allValues = this.right.map(value => value.value);
|
|
12178
12178
|
const allValuesStr = allValues.join(',');
|
|
12179
12179
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
12180
|
-
s = `!alasql.sets[
|
|
12180
|
+
s = `!alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
12181
12181
|
}
|
|
12182
12182
|
} else {
|
|
12183
12183
|
s = `(${rightJS()}.indexOf(${leftJS()}) === -1)`;
|
|
@@ -14330,7 +14330,7 @@ yy.CreateTable.prototype.execute = function (databaseid, params, cb) {
|
|
|
14330
14330
|
|
|
14331
14331
|
table.update(
|
|
14332
14332
|
function (t) {
|
|
14333
|
-
for (var f in r) t[f] = r[f];
|
|
14333
|
+
for (var f in r) {if(/^__proto__$/.test(f))Object.defineProperty(t,f,{writable:true,enumerable:true,configurable:true});t[f] = r[f];}
|
|
14334
14334
|
},
|
|
14335
14335
|
table.data.indexOf(toreplace),
|
|
14336
14336
|
params
|
|
@@ -16162,7 +16162,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
16162
16162
|
});
|
|
16163
16163
|
} else {
|
|
16164
16164
|
|
|
16165
|
-
// sw = 'var w='+JSONtoJS(values)+';for(var k in w){r[k]=w[k]};';
|
|
16165
|
+
// sw = 'var w='+JSONtoJS(values)+';for(var k in w){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=w[k]};';
|
|
16166
16166
|
sw = JSONtoJS(values);
|
|
16167
16167
|
}
|
|
16168
16168
|
}
|
|
@@ -16241,7 +16241,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
16241
16241
|
self.output.columns.forEach(function (col) {
|
|
16242
16242
|
if (col.columnid === '*') {
|
|
16243
16243
|
// For *, expand all properties
|
|
16244
|
-
s += 'for(var key in r){ outputRow[key] = r[key]; }';
|
|
16244
|
+
s += 'for(var key in r){ if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key]; }';
|
|
16245
16245
|
} else {
|
|
16246
16246
|
var colname = col.as || col.columnid;
|
|
16247
16247
|
// Direct property access for simple columns
|
|
@@ -16320,7 +16320,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
16320
16320
|
if (col.columnid === '*') {
|
|
16321
16321
|
// For *, expand all properties
|
|
16322
16322
|
for (var key in r) {
|
|
16323
|
-
outputRow[key] = r[key];
|
|
16323
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16324
16324
|
}
|
|
16325
16325
|
} else {
|
|
16326
16326
|
var colname = col.as || col.columnid;
|
|
@@ -16672,7 +16672,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16672
16672
|
if (col.columnid === '*') {
|
|
16673
16673
|
// For *, expand all properties
|
|
16674
16674
|
for (var key in r) {
|
|
16675
|
-
outputRow[key] = r[key];
|
|
16675
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16676
16676
|
}
|
|
16677
16677
|
} else {
|
|
16678
16678
|
var colname = col.as || col.columnid;
|
|
@@ -16743,7 +16743,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16743
16743
|
if (col.columnid === '*') {
|
|
16744
16744
|
// For *, expand all properties
|
|
16745
16745
|
for (var key in r) {
|
|
16746
|
-
outputRow[key] = r[key];
|
|
16746
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16747
16747
|
}
|
|
16748
16748
|
} else {
|
|
16749
16749
|
var colname = col.as || col.columnid;
|
|
@@ -16914,7 +16914,7 @@ yy.Update.prototype.compile = function (databaseid) {
|
|
|
16914
16914
|
if (col.columnid === '*') {
|
|
16915
16915
|
// For *, use INSERTED values
|
|
16916
16916
|
for (var key in inserted) {
|
|
16917
|
-
outputRow[key] = inserted[key];
|
|
16917
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = inserted[key];
|
|
16918
16918
|
}
|
|
16919
16919
|
} else {
|
|
16920
16920
|
var colname = col.as || col.columnid;
|
|
@@ -17481,22 +17481,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
|
|
|
17481
17481
|
if (this.props && this.props.length > 0) {
|
|
17482
17482
|
let fs;
|
|
17483
17483
|
if (this.method === '@') {
|
|
17484
|
-
fs = `alasql.vars['${this.variable}']`;
|
|
17484
|
+
fs = `alasql.vars[k('${this.variable}')]`;
|
|
17485
17485
|
} else {
|
|
17486
|
-
fs = `params['${this.variable}']`;
|
|
17486
|
+
fs = `params[k('${this.variable}')]`;
|
|
17487
17487
|
}
|
|
17488
17488
|
this.props.forEach(prop => {
|
|
17489
17489
|
if (typeof prop === 'string') {
|
|
17490
|
-
fs += `['${prop}']`;
|
|
17490
|
+
fs += `[k('${prop}')]`;
|
|
17491
17491
|
} else if (typeof prop === 'number') {
|
|
17492
17492
|
fs += `[${prop}]`;
|
|
17493
17493
|
} else {
|
|
17494
17494
|
// Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
|
|
17495
|
-
fs += `[${prop.toJS()}]`;
|
|
17495
|
+
fs += `[k(${prop.toJS()})]`;
|
|
17496
17496
|
}
|
|
17497
17497
|
});
|
|
17498
17498
|
|
|
17499
|
-
new Function('value, params, alasql',
|
|
17499
|
+
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);
|
|
17500
17500
|
} else {
|
|
17501
17501
|
if (this.method === '@') {
|
|
17502
17502
|
alasql.vars[this.variable] = res;
|