alasql 4.17.3 → 4.17.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 +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 +30 -30
- package/package.json +1 -1
package/bin/alasql-cli.js
CHANGED
package/dist/alasql-worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.17.
|
|
1
|
+
//! AlaSQL v4.17.5 build: develop-f960d23a | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.17.
|
|
4
|
+
@version 4.17.5
|
|
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.17.
|
|
1
|
+
//! AlaSQL v4.17.5 build: develop-f960d23a | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.17.
|
|
4
|
+
@version 4.17.5
|
|
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.17.
|
|
144
|
+
alasql.version = '4.17.5';
|
|
145
145
|
alasql.build = 'develop-f960d23a';
|
|
146
146
|
|
|
147
147
|
/**
|
|
@@ -3003,7 +3003,7 @@ next:function () {
|
|
|
3003
3003
|
|
|
3004
3004
|
// return next match that has a token
|
|
3005
3005
|
lex:function lex () {
|
|
3006
|
-
var r = this.next();
|
|
3006
|
+
var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
|
|
3007
3007
|
if (r) {
|
|
3008
3008
|
return r;
|
|
3009
3009
|
} else {
|
|
@@ -4581,11 +4581,11 @@ var cloneDeep = (utils.cloneDeep = function cloneDeep(obj) {
|
|
|
4581
4581
|
return +obj;
|
|
4582
4582
|
}
|
|
4583
4583
|
|
|
4584
|
-
var temp = new obj.constructor(); // changed
|
|
4584
|
+
var temp = new (Object.prototype.hasOwnProperty.call(obj, 'constructor') ? Object : obj.constructor)(); // changed
|
|
4585
4585
|
|
|
4586
4586
|
for (var key in obj) {
|
|
4587
4587
|
if (obj.hasOwnProperty(key)) {
|
|
4588
|
-
temp[key] = cloneDeep(obj[key]);
|
|
4588
|
+
/* 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]); }
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
4591
|
return temp;
|
|
@@ -4657,7 +4657,7 @@ var extend = (utils.extend = function extend(a, b) {
|
|
|
4657
4657
|
a = a || {};
|
|
4658
4658
|
for (var key in b) {
|
|
4659
4659
|
if (b.hasOwnProperty(key)) {
|
|
4660
|
-
a[key] = b[key];
|
|
4660
|
+
/* 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]; }
|
|
4661
4661
|
}
|
|
4662
4662
|
}
|
|
4663
4663
|
return a;
|
|
@@ -7254,7 +7254,7 @@ function queryfn3(query) {
|
|
|
7254
7254
|
|
|
7255
7255
|
// Prepare variables
|
|
7256
7256
|
query.data = [];
|
|
7257
|
-
query.xgroups
|
|
7257
|
+
query.xgroups=Object.create(null);
|
|
7258
7258
|
query.groups = [];
|
|
7259
7259
|
|
|
7260
7260
|
// Level of Joins
|
|
@@ -8317,7 +8317,7 @@ yy.Select = class Select {
|
|
|
8317
8317
|
var converted = {};
|
|
8318
8318
|
for (var key in r) {
|
|
8319
8319
|
var colDef = table.xcolumns && table.xcolumns[key];
|
|
8320
|
-
|
|
8320
|
+
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}
|
|
8321
8321
|
}
|
|
8322
8322
|
table.data.push(converted);
|
|
8323
8323
|
`;
|
|
@@ -9615,7 +9615,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
9615
9615
|
aft2 = '';
|
|
9616
9616
|
|
|
9617
9617
|
if (typeof query.groupStar !== 'undefined') {
|
|
9618
|
-
aft2 += "for(var f in p['" + query.groupStar + "']) {g[f]=p['" + query.groupStar + "'][f];};";
|
|
9618
|
+
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];};";
|
|
9619
9619
|
}
|
|
9620
9620
|
|
|
9621
9621
|
s += query.selectGroup
|
|
@@ -10099,7 +10099,7 @@ function compileSelectStar(query, aliases, joinstar) {
|
|
|
10099
10099
|
'var w=p["' + escapeq(alias) + '"];for(var k in w){r["' + escapeq(alias) + '_"+k]=w[k]};';
|
|
10100
10100
|
} else {
|
|
10101
10101
|
// Default overwrite mode
|
|
10102
|
-
sp += 'var w=p["' + escapeq(alias) + '"];for(var k in w){r[k]=w[k]};';
|
|
10102
|
+
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]};';
|
|
10103
10103
|
}
|
|
10104
10104
|
|
|
10105
10105
|
query.dirtyColumns = true;
|
|
@@ -10575,10 +10575,10 @@ yy.Select.prototype.compileSelectGroup1 = function (query) {
|
|
|
10575
10575
|
self.columns.forEach(function (col) {
|
|
10576
10576
|
|
|
10577
10577
|
if (col instanceof yy.Column && col.columnid === '*') {
|
|
10578
|
-
// s += 'for(var k in g){r[k]=g[k]};';
|
|
10578
|
+
// s += 'for(var k in g){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10579
10579
|
// s += 'for(var k in this.query.groupColumns){r[k]=g[this.query.groupColumns[k]]};';
|
|
10580
10580
|
|
|
10581
|
-
s += 'for(var k in g) {r[k]=g[k]};';
|
|
10581
|
+
s += 'for(var k in g) {if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10582
10582
|
return '';
|
|
10583
10583
|
|
|
10584
10584
|
} else {
|
|
@@ -11880,7 +11880,7 @@ yy.Over = class Over {
|
|
|
11880
11880
|
const allValues = this.right.map(value => value.value);
|
|
11881
11881
|
const allValuesStr = allValues.join(',');
|
|
11882
11882
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
11883
|
-
s = `alasql.sets[
|
|
11883
|
+
s = `alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
11884
11884
|
}
|
|
11885
11885
|
} else {
|
|
11886
11886
|
s = `(${rightJS()}.indexOf(${leftJS()}) > -1)`;
|
|
@@ -11914,7 +11914,7 @@ yy.Over = class Over {
|
|
|
11914
11914
|
const allValues = this.right.map(value => value.value);
|
|
11915
11915
|
const allValuesStr = allValues.join(',');
|
|
11916
11916
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
11917
|
-
s = `!alasql.sets[
|
|
11917
|
+
s = `!alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
11918
11918
|
}
|
|
11919
11919
|
} else {
|
|
11920
11920
|
s = `(${rightJS()}.indexOf(${leftJS()}) === -1)`;
|
|
@@ -13941,7 +13941,7 @@ yy.CreateTable.prototype.execute = function (databaseid, params, cb) {
|
|
|
13941
13941
|
|
|
13942
13942
|
table.update(
|
|
13943
13943
|
function (t) {
|
|
13944
|
-
for (var f in r) t[f] = r[f];
|
|
13944
|
+
for (var f in r) {if(/^__proto__$/.test(f))Object.defineProperty(t,f,{writable:true,enumerable:true,configurable:true});t[f] = r[f];}
|
|
13945
13945
|
},
|
|
13946
13946
|
table.data.indexOf(toreplace),
|
|
13947
13947
|
params
|
|
@@ -15712,7 +15712,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
15712
15712
|
});
|
|
15713
15713
|
} else {
|
|
15714
15714
|
|
|
15715
|
-
// sw = 'var w='+JSONtoJS(values)+';for(var k in w){r[k]=w[k]};';
|
|
15715
|
+
// 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]};';
|
|
15716
15716
|
sw = JSONtoJS(values);
|
|
15717
15717
|
}
|
|
15718
15718
|
}
|
|
@@ -15791,7 +15791,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
15791
15791
|
self.output.columns.forEach(function (col) {
|
|
15792
15792
|
if (col.columnid === '*') {
|
|
15793
15793
|
// For *, expand all properties
|
|
15794
|
-
s += 'for(var key in r){ outputRow[key] = r[key]; }';
|
|
15794
|
+
s += 'for(var key in r){ if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key]; }';
|
|
15795
15795
|
} else {
|
|
15796
15796
|
var colname = col.as || col.columnid;
|
|
15797
15797
|
// Direct property access for simple columns
|
|
@@ -15870,7 +15870,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
15870
15870
|
if (col.columnid === '*') {
|
|
15871
15871
|
// For *, expand all properties
|
|
15872
15872
|
for (var key in r) {
|
|
15873
|
-
outputRow[key] = r[key];
|
|
15873
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
15874
15874
|
}
|
|
15875
15875
|
} else {
|
|
15876
15876
|
var colname = col.as || col.columnid;
|
|
@@ -16221,7 +16221,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16221
16221
|
if (col.columnid === '*') {
|
|
16222
16222
|
// For *, expand all properties
|
|
16223
16223
|
for (var key in r) {
|
|
16224
|
-
outputRow[key] = r[key];
|
|
16224
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16225
16225
|
}
|
|
16226
16226
|
} else {
|
|
16227
16227
|
var colname = col.as || col.columnid;
|
|
@@ -16292,7 +16292,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16292
16292
|
if (col.columnid === '*') {
|
|
16293
16293
|
// For *, expand all properties
|
|
16294
16294
|
for (var key in r) {
|
|
16295
|
-
outputRow[key] = r[key];
|
|
16295
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16296
16296
|
}
|
|
16297
16297
|
} else {
|
|
16298
16298
|
var colname = col.as || col.columnid;
|
|
@@ -16462,7 +16462,7 @@ yy.Update.prototype.compile = function (databaseid) {
|
|
|
16462
16462
|
if (col.columnid === '*') {
|
|
16463
16463
|
// For *, use INSERTED values
|
|
16464
16464
|
for (var key in inserted) {
|
|
16465
|
-
outputRow[key] = inserted[key];
|
|
16465
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = inserted[key];
|
|
16466
16466
|
}
|
|
16467
16467
|
} else {
|
|
16468
16468
|
var colname = col.as || col.columnid;
|
|
@@ -17020,22 +17020,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
|
|
|
17020
17020
|
if (this.props && this.props.length > 0) {
|
|
17021
17021
|
let fs;
|
|
17022
17022
|
if (this.method === '@') {
|
|
17023
|
-
fs = `alasql.vars['${this.variable}']`;
|
|
17023
|
+
fs = `alasql.vars[k('${this.variable}')]`;
|
|
17024
17024
|
} else {
|
|
17025
|
-
fs = `params['${this.variable}']`;
|
|
17025
|
+
fs = `params[k('${this.variable}')]`;
|
|
17026
17026
|
}
|
|
17027
17027
|
this.props.forEach(prop => {
|
|
17028
17028
|
if (typeof prop === 'string') {
|
|
17029
|
-
fs += `['${prop}']`;
|
|
17029
|
+
fs += `[k('${prop}')]`;
|
|
17030
17030
|
} else if (typeof prop === 'number') {
|
|
17031
17031
|
fs += `[${prop}]`;
|
|
17032
17032
|
} else {
|
|
17033
17033
|
// Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
|
|
17034
|
-
fs += `[${prop.toJS()}]`;
|
|
17034
|
+
fs += `[k(${prop.toJS()})]`;
|
|
17035
17035
|
}
|
|
17036
17036
|
});
|
|
17037
17037
|
|
|
17038
|
-
new Function('value, params, alasql',
|
|
17038
|
+
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);
|
|
17039
17039
|
} else {
|
|
17040
17040
|
if (this.method === '@') {
|
|
17041
17041
|
alasql.vars[this.variable] = res;
|
package/dist/alasql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.17.
|
|
1
|
+
//! AlaSQL v4.17.5 build: develop-f960d23a | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.17.
|
|
4
|
+
@version 4.17.5
|
|
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.17.
|
|
144
|
+
alasql.version = '4.17.5';
|
|
145
145
|
alasql.build = 'develop-f960d23a';
|
|
146
146
|
|
|
147
147
|
/**
|
|
@@ -3003,7 +3003,7 @@ next:function () {
|
|
|
3003
3003
|
|
|
3004
3004
|
// return next match that has a token
|
|
3005
3005
|
lex:function lex () {
|
|
3006
|
-
var r = this.next();
|
|
3006
|
+
var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
|
|
3007
3007
|
if (r) {
|
|
3008
3008
|
return r;
|
|
3009
3009
|
} else {
|
|
@@ -4581,11 +4581,11 @@ var cloneDeep = (utils.cloneDeep = function cloneDeep(obj) {
|
|
|
4581
4581
|
return +obj;
|
|
4582
4582
|
}
|
|
4583
4583
|
|
|
4584
|
-
var temp = new obj.constructor(); // changed
|
|
4584
|
+
var temp = new (Object.prototype.hasOwnProperty.call(obj, 'constructor') ? Object : obj.constructor)(); // changed
|
|
4585
4585
|
|
|
4586
4586
|
for (var key in obj) {
|
|
4587
4587
|
if (obj.hasOwnProperty(key)) {
|
|
4588
|
-
temp[key] = cloneDeep(obj[key]);
|
|
4588
|
+
/* 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]); }
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
4591
|
return temp;
|
|
@@ -4657,7 +4657,7 @@ var extend = (utils.extend = function extend(a, b) {
|
|
|
4657
4657
|
a = a || {};
|
|
4658
4658
|
for (var key in b) {
|
|
4659
4659
|
if (b.hasOwnProperty(key)) {
|
|
4660
|
-
a[key] = b[key];
|
|
4660
|
+
/* 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]; }
|
|
4661
4661
|
}
|
|
4662
4662
|
}
|
|
4663
4663
|
return a;
|
|
@@ -7254,7 +7254,7 @@ function queryfn3(query) {
|
|
|
7254
7254
|
|
|
7255
7255
|
// Prepare variables
|
|
7256
7256
|
query.data = [];
|
|
7257
|
-
query.xgroups
|
|
7257
|
+
query.xgroups=Object.create(null);
|
|
7258
7258
|
query.groups = [];
|
|
7259
7259
|
|
|
7260
7260
|
// Level of Joins
|
|
@@ -8317,7 +8317,7 @@ yy.Select = class Select {
|
|
|
8317
8317
|
var converted = {};
|
|
8318
8318
|
for (var key in r) {
|
|
8319
8319
|
var colDef = table.xcolumns && table.xcolumns[key];
|
|
8320
|
-
|
|
8320
|
+
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}
|
|
8321
8321
|
}
|
|
8322
8322
|
table.data.push(converted);
|
|
8323
8323
|
`;
|
|
@@ -9615,7 +9615,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
9615
9615
|
aft2 = '';
|
|
9616
9616
|
|
|
9617
9617
|
if (typeof query.groupStar !== 'undefined') {
|
|
9618
|
-
aft2 += "for(var f in p['" + query.groupStar + "']) {g[f]=p['" + query.groupStar + "'][f];};";
|
|
9618
|
+
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];};";
|
|
9619
9619
|
}
|
|
9620
9620
|
|
|
9621
9621
|
s += query.selectGroup
|
|
@@ -10099,7 +10099,7 @@ function compileSelectStar(query, aliases, joinstar) {
|
|
|
10099
10099
|
'var w=p["' + escapeq(alias) + '"];for(var k in w){r["' + escapeq(alias) + '_"+k]=w[k]};';
|
|
10100
10100
|
} else {
|
|
10101
10101
|
// Default overwrite mode
|
|
10102
|
-
sp += 'var w=p["' + escapeq(alias) + '"];for(var k in w){r[k]=w[k]};';
|
|
10102
|
+
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]};';
|
|
10103
10103
|
}
|
|
10104
10104
|
|
|
10105
10105
|
query.dirtyColumns = true;
|
|
@@ -10575,10 +10575,10 @@ yy.Select.prototype.compileSelectGroup1 = function (query) {
|
|
|
10575
10575
|
self.columns.forEach(function (col) {
|
|
10576
10576
|
|
|
10577
10577
|
if (col instanceof yy.Column && col.columnid === '*') {
|
|
10578
|
-
// s += 'for(var k in g){r[k]=g[k]};';
|
|
10578
|
+
// s += 'for(var k in g){if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10579
10579
|
// s += 'for(var k in this.query.groupColumns){r[k]=g[this.query.groupColumns[k]]};';
|
|
10580
10580
|
|
|
10581
|
-
s += 'for(var k in g) {r[k]=g[k]};';
|
|
10581
|
+
s += 'for(var k in g) {if(/^__proto__$/.test(k))Object.defineProperty(r,k,{writable:true,enumerable:true,configurable:true});r[k]=g[k]};';
|
|
10582
10582
|
return '';
|
|
10583
10583
|
|
|
10584
10584
|
} else {
|
|
@@ -11880,7 +11880,7 @@ yy.Over = class Over {
|
|
|
11880
11880
|
const allValues = this.right.map(value => value.value);
|
|
11881
11881
|
const allValuesStr = allValues.join(',');
|
|
11882
11882
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
11883
|
-
s = `alasql.sets[
|
|
11883
|
+
s = `alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
11884
11884
|
}
|
|
11885
11885
|
} else {
|
|
11886
11886
|
s = `(${rightJS()}.indexOf(${leftJS()}) > -1)`;
|
|
@@ -11914,7 +11914,7 @@ yy.Over = class Over {
|
|
|
11914
11914
|
const allValues = this.right.map(value => value.value);
|
|
11915
11915
|
const allValuesStr = allValues.join(',');
|
|
11916
11916
|
alasql.sets[allValuesStr] = alasql.sets[allValuesStr] || new Set(allValues);
|
|
11917
|
-
s = `!alasql.sets[
|
|
11917
|
+
s = `!alasql.sets[${JSON.stringify(allValuesStr)}].has(alasql.utils.getValueOf(${leftJS()}))`;
|
|
11918
11918
|
}
|
|
11919
11919
|
} else {
|
|
11920
11920
|
s = `(${rightJS()}.indexOf(${leftJS()}) === -1)`;
|
|
@@ -13941,7 +13941,7 @@ yy.CreateTable.prototype.execute = function (databaseid, params, cb) {
|
|
|
13941
13941
|
|
|
13942
13942
|
table.update(
|
|
13943
13943
|
function (t) {
|
|
13944
|
-
for (var f in r) t[f] = r[f];
|
|
13944
|
+
for (var f in r) {if(/^__proto__$/.test(f))Object.defineProperty(t,f,{writable:true,enumerable:true,configurable:true});t[f] = r[f];}
|
|
13945
13945
|
},
|
|
13946
13946
|
table.data.indexOf(toreplace),
|
|
13947
13947
|
params
|
|
@@ -15712,7 +15712,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
15712
15712
|
});
|
|
15713
15713
|
} else {
|
|
15714
15714
|
|
|
15715
|
-
// sw = 'var w='+JSONtoJS(values)+';for(var k in w){r[k]=w[k]};';
|
|
15715
|
+
// 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]};';
|
|
15716
15716
|
sw = JSONtoJS(values);
|
|
15717
15717
|
}
|
|
15718
15718
|
}
|
|
@@ -15791,7 +15791,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
15791
15791
|
self.output.columns.forEach(function (col) {
|
|
15792
15792
|
if (col.columnid === '*') {
|
|
15793
15793
|
// For *, expand all properties
|
|
15794
|
-
s += 'for(var key in r){ outputRow[key] = r[key]; }';
|
|
15794
|
+
s += 'for(var key in r){ if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key]; }';
|
|
15795
15795
|
} else {
|
|
15796
15796
|
var colname = col.as || col.columnid;
|
|
15797
15797
|
// Direct property access for simple columns
|
|
@@ -15870,7 +15870,7 @@ yy.Insert.prototype.compile = function (databaseid) {
|
|
|
15870
15870
|
if (col.columnid === '*') {
|
|
15871
15871
|
// For *, expand all properties
|
|
15872
15872
|
for (var key in r) {
|
|
15873
|
-
outputRow[key] = r[key];
|
|
15873
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
15874
15874
|
}
|
|
15875
15875
|
} else {
|
|
15876
15876
|
var colname = col.as || col.columnid;
|
|
@@ -16221,7 +16221,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16221
16221
|
if (col.columnid === '*') {
|
|
16222
16222
|
// For *, expand all properties
|
|
16223
16223
|
for (var key in r) {
|
|
16224
|
-
outputRow[key] = r[key];
|
|
16224
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16225
16225
|
}
|
|
16226
16226
|
} else {
|
|
16227
16227
|
var colname = col.as || col.columnid;
|
|
@@ -16292,7 +16292,7 @@ yy.Delete.prototype.compile = function (databaseid) {
|
|
|
16292
16292
|
if (col.columnid === '*') {
|
|
16293
16293
|
// For *, expand all properties
|
|
16294
16294
|
for (var key in r) {
|
|
16295
|
-
outputRow[key] = r[key];
|
|
16295
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = r[key];
|
|
16296
16296
|
}
|
|
16297
16297
|
} else {
|
|
16298
16298
|
var colname = col.as || col.columnid;
|
|
@@ -16462,7 +16462,7 @@ yy.Update.prototype.compile = function (databaseid) {
|
|
|
16462
16462
|
if (col.columnid === '*') {
|
|
16463
16463
|
// For *, use INSERTED values
|
|
16464
16464
|
for (var key in inserted) {
|
|
16465
|
-
outputRow[key] = inserted[key];
|
|
16465
|
+
if(/^__proto__$/.test(key))Object.defineProperty(outputRow,key,{writable:true,enumerable:true,configurable:true});outputRow[key] = inserted[key];
|
|
16466
16466
|
}
|
|
16467
16467
|
} else {
|
|
16468
16468
|
var colname = col.as || col.columnid;
|
|
@@ -17020,22 +17020,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
|
|
|
17020
17020
|
if (this.props && this.props.length > 0) {
|
|
17021
17021
|
let fs;
|
|
17022
17022
|
if (this.method === '@') {
|
|
17023
|
-
fs = `alasql.vars['${this.variable}']`;
|
|
17023
|
+
fs = `alasql.vars[k('${this.variable}')]`;
|
|
17024
17024
|
} else {
|
|
17025
|
-
fs = `params['${this.variable}']`;
|
|
17025
|
+
fs = `params[k('${this.variable}')]`;
|
|
17026
17026
|
}
|
|
17027
17027
|
this.props.forEach(prop => {
|
|
17028
17028
|
if (typeof prop === 'string') {
|
|
17029
|
-
fs += `['${prop}']`;
|
|
17029
|
+
fs += `[k('${prop}')]`;
|
|
17030
17030
|
} else if (typeof prop === 'number') {
|
|
17031
17031
|
fs += `[${prop}]`;
|
|
17032
17032
|
} else {
|
|
17033
17033
|
// Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
|
|
17034
|
-
fs += `[${prop.toJS()}]`;
|
|
17034
|
+
fs += `[k(${prop.toJS()})]`;
|
|
17035
17035
|
}
|
|
17036
17036
|
});
|
|
17037
17037
|
|
|
17038
|
-
new Function('value, params, alasql',
|
|
17038
|
+
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);
|
|
17039
17039
|
} else {
|
|
17040
17040
|
if (this.method === '@') {
|
|
17041
17041
|
alasql.vars[this.variable] = res;
|