ses 0.18.5 → 0.18.7
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/NEWS.md +8 -0
- package/dist/lockdown.cjs +31 -8
- package/dist/lockdown.mjs +31 -8
- package/dist/lockdown.umd.js +31 -8
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses.cjs +31 -8
- package/dist/ses.mjs +31 -8
- package/dist/ses.umd.js +31 -8
- package/dist/ses.umd.min.js +1 -1
- package/package.json +6 -6
- package/src/error/stringify-utils.js +25 -1
- package/src/permits.js +2 -3
- package/src/transforms.js +1 -1
package/NEWS.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
User-visible changes in SES:
|
|
2
2
|
|
|
3
|
+
# v0.18.6 (2023-08-07)
|
|
4
|
+
|
|
5
|
+
- Censors the pattern `{...import(specifier)`}.
|
|
6
|
+
We previously censored `import(specifier)` and expressly allowed
|
|
7
|
+
`object.import(specifier)`.
|
|
8
|
+
The relaxation for the latter form in version 0.13.0 inadvertently allowed
|
|
9
|
+
import with the spread operator.
|
|
10
|
+
|
|
3
11
|
# v0.18.5 (2023-07-14)
|
|
4
12
|
|
|
5
13
|
- Adds `assert.bare` for embedding unquoted strings in details.
|
package/dist/lockdown.cjs
CHANGED
|
@@ -1204,6 +1204,7 @@ const permitted= {
|
|
|
1204
1204
|
dotAll: getter,
|
|
1205
1205
|
flags: getter,
|
|
1206
1206
|
global: getter,
|
|
1207
|
+
hasIndices: getter,
|
|
1207
1208
|
ignoreCase: getter,
|
|
1208
1209
|
'@@match': fn,
|
|
1209
1210
|
'@@matchAll': fn,
|
|
@@ -1216,13 +1217,11 @@ const permitted= {
|
|
|
1216
1217
|
test: fn,
|
|
1217
1218
|
toString: fn,
|
|
1218
1219
|
unicode: getter,
|
|
1220
|
+
unicodeSets: getter,
|
|
1219
1221
|
|
|
1220
1222
|
// Annex B: Additional Properties of the RegExp.prototype Object
|
|
1221
|
-
compile: false
|
|
1222
|
-
|
|
1223
|
-
// Safari Tech Preview Release 122 (Safari 14.2, WebKit 16612.1.6.2)
|
|
1224
|
-
hasIndices: false},
|
|
1225
|
-
|
|
1223
|
+
compile: false // UNSAFE and suppressed.
|
|
1224
|
+
},
|
|
1226
1225
|
|
|
1227
1226
|
'%RegExpStringIteratorPrototype%': {
|
|
1228
1227
|
// The %RegExpStringIteratorPrototype% Object
|
|
@@ -2138,7 +2137,12 @@ freeze(makeEnvironmentCaptor);
|
|
|
2138
2137
|
})
|
|
2139
2138
|
,
|
|
2140
2139
|
// === functors[6] ===
|
|
2141
|
-
(({ imports: $h_imports, liveVar: $h_live, onceVar: $h_once, importMeta: $h____meta, }) => { let Set,String,arrayJoin,arraySlice,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h_imports([["../commons.js", [["Set", [$h_a => (Set = $h_a)]],["String", [$h_a => (String = $h_a)]],["arrayJoin", [$h_a => (arrayJoin = $h_a)]],["arraySlice", [$h_a => (arraySlice = $h_a)]],["freeze", [$h_a => (freeze = $h_a)]],["is", [$h_a => (is = $h_a)]],["isError", [$h_a => (isError = $h_a)]],["setAdd", [$h_a => (setAdd = $h_a)]],["setHas", [$h_a => (setHas = $h_a)]],["stringIncludes", [$h_a => (stringIncludes = $h_a)]],["stringStartsWith", [$h_a => (stringStartsWith = $h_a)]],["stringifyJson", [$h_a => (stringifyJson = $h_a)]],["toStringTagSymbol", [$h_a => (toStringTagSymbol = $h_a)]]]]]);
|
|
2140
|
+
(({ imports: $h_imports, liveVar: $h_live, onceVar: $h_once, importMeta: $h____meta, }) => { let Set,String,isArray,arrayJoin,arraySlice,arraySort,arrayMap,keys,fromEntries,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h_imports([["../commons.js", [["Set", [$h_a => (Set = $h_a)]],["String", [$h_a => (String = $h_a)]],["isArray", [$h_a => (isArray = $h_a)]],["arrayJoin", [$h_a => (arrayJoin = $h_a)]],["arraySlice", [$h_a => (arraySlice = $h_a)]],["arraySort", [$h_a => (arraySort = $h_a)]],["arrayMap", [$h_a => (arrayMap = $h_a)]],["keys", [$h_a => (keys = $h_a)]],["fromEntries", [$h_a => (fromEntries = $h_a)]],["freeze", [$h_a => (freeze = $h_a)]],["is", [$h_a => (is = $h_a)]],["isError", [$h_a => (isError = $h_a)]],["setAdd", [$h_a => (setAdd = $h_a)]],["setHas", [$h_a => (setHas = $h_a)]],["stringIncludes", [$h_a => (stringIncludes = $h_a)]],["stringStartsWith", [$h_a => (stringStartsWith = $h_a)]],["stringifyJson", [$h_a => (stringifyJson = $h_a)]],["toStringTagSymbol", [$h_a => (toStringTagSymbol = $h_a)]]]]]);
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2142
2146
|
|
|
2143
2147
|
|
|
2144
2148
|
|
|
@@ -2260,7 +2264,26 @@ const bestEffortStringify= (payload, spaces= undefined)=> {
|
|
|
2260
2264
|
// and their remote presences in the first place.
|
|
2261
2265
|
return `[${val[toStringTagSymbol]}]`;
|
|
2262
2266
|
}
|
|
2263
|
-
|
|
2267
|
+
if( isArray(val)) {
|
|
2268
|
+
return val;
|
|
2269
|
+
}
|
|
2270
|
+
const names= keys(val);
|
|
2271
|
+
if( names.length< 2) {
|
|
2272
|
+
return val;
|
|
2273
|
+
}
|
|
2274
|
+
let sorted= true;
|
|
2275
|
+
for( let i= 1; i< names.length; i+= 1) {
|
|
2276
|
+
if( names[i- 1]>= names[i]) {
|
|
2277
|
+
sorted= false;
|
|
2278
|
+
break;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
if( sorted) {
|
|
2282
|
+
return val;
|
|
2283
|
+
}
|
|
2284
|
+
arraySort(names);
|
|
2285
|
+
const entries= arrayMap(names, (name)=>[name, val[name]]);
|
|
2286
|
+
return fromEntries(entries);
|
|
2264
2287
|
}
|
|
2265
2288
|
case 'function': {
|
|
2266
2289
|
return `[Function ${val.name|| '<anon>' }]`;
|
|
@@ -5679,7 +5702,7 @@ const evadeHtmlCommentTest= (src)=>{
|
|
|
5679
5702
|
// /////////////////////////////////////////////////////////////////////////////
|
|
5680
5703
|
$h_once.evadeHtmlCommentTest(evadeHtmlCommentTest);
|
|
5681
5704
|
const importPattern= new FERAL_REG_EXP(
|
|
5682
|
-
'(^|[^.])\\bimport(\\s*(?:\\(|/[/*]))',
|
|
5705
|
+
'(^|[^.]|\\.\\.\\.)\\bimport(\\s*(?:\\(|/[/*]))',
|
|
5683
5706
|
'g');
|
|
5684
5707
|
|
|
5685
5708
|
|
package/dist/lockdown.mjs
CHANGED
|
@@ -1204,6 +1204,7 @@ const permitted= {
|
|
|
1204
1204
|
dotAll: getter,
|
|
1205
1205
|
flags: getter,
|
|
1206
1206
|
global: getter,
|
|
1207
|
+
hasIndices: getter,
|
|
1207
1208
|
ignoreCase: getter,
|
|
1208
1209
|
'@@match': fn,
|
|
1209
1210
|
'@@matchAll': fn,
|
|
@@ -1216,13 +1217,11 @@ const permitted= {
|
|
|
1216
1217
|
test: fn,
|
|
1217
1218
|
toString: fn,
|
|
1218
1219
|
unicode: getter,
|
|
1220
|
+
unicodeSets: getter,
|
|
1219
1221
|
|
|
1220
1222
|
// Annex B: Additional Properties of the RegExp.prototype Object
|
|
1221
|
-
compile: false
|
|
1222
|
-
|
|
1223
|
-
// Safari Tech Preview Release 122 (Safari 14.2, WebKit 16612.1.6.2)
|
|
1224
|
-
hasIndices: false},
|
|
1225
|
-
|
|
1223
|
+
compile: false // UNSAFE and suppressed.
|
|
1224
|
+
},
|
|
1226
1225
|
|
|
1227
1226
|
'%RegExpStringIteratorPrototype%': {
|
|
1228
1227
|
// The %RegExpStringIteratorPrototype% Object
|
|
@@ -2138,7 +2137,12 @@ freeze(makeEnvironmentCaptor);
|
|
|
2138
2137
|
})
|
|
2139
2138
|
,
|
|
2140
2139
|
// === functors[6] ===
|
|
2141
|
-
(({ imports: $h_imports, liveVar: $h_live, onceVar: $h_once, importMeta: $h____meta, }) => { let Set,String,arrayJoin,arraySlice,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h_imports([["../commons.js", [["Set", [$h_a => (Set = $h_a)]],["String", [$h_a => (String = $h_a)]],["arrayJoin", [$h_a => (arrayJoin = $h_a)]],["arraySlice", [$h_a => (arraySlice = $h_a)]],["freeze", [$h_a => (freeze = $h_a)]],["is", [$h_a => (is = $h_a)]],["isError", [$h_a => (isError = $h_a)]],["setAdd", [$h_a => (setAdd = $h_a)]],["setHas", [$h_a => (setHas = $h_a)]],["stringIncludes", [$h_a => (stringIncludes = $h_a)]],["stringStartsWith", [$h_a => (stringStartsWith = $h_a)]],["stringifyJson", [$h_a => (stringifyJson = $h_a)]],["toStringTagSymbol", [$h_a => (toStringTagSymbol = $h_a)]]]]]);
|
|
2140
|
+
(({ imports: $h_imports, liveVar: $h_live, onceVar: $h_once, importMeta: $h____meta, }) => { let Set,String,isArray,arrayJoin,arraySlice,arraySort,arrayMap,keys,fromEntries,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h_imports([["../commons.js", [["Set", [$h_a => (Set = $h_a)]],["String", [$h_a => (String = $h_a)]],["isArray", [$h_a => (isArray = $h_a)]],["arrayJoin", [$h_a => (arrayJoin = $h_a)]],["arraySlice", [$h_a => (arraySlice = $h_a)]],["arraySort", [$h_a => (arraySort = $h_a)]],["arrayMap", [$h_a => (arrayMap = $h_a)]],["keys", [$h_a => (keys = $h_a)]],["fromEntries", [$h_a => (fromEntries = $h_a)]],["freeze", [$h_a => (freeze = $h_a)]],["is", [$h_a => (is = $h_a)]],["isError", [$h_a => (isError = $h_a)]],["setAdd", [$h_a => (setAdd = $h_a)]],["setHas", [$h_a => (setHas = $h_a)]],["stringIncludes", [$h_a => (stringIncludes = $h_a)]],["stringStartsWith", [$h_a => (stringStartsWith = $h_a)]],["stringifyJson", [$h_a => (stringifyJson = $h_a)]],["toStringTagSymbol", [$h_a => (toStringTagSymbol = $h_a)]]]]]);
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2142
2146
|
|
|
2143
2147
|
|
|
2144
2148
|
|
|
@@ -2260,7 +2264,26 @@ const bestEffortStringify= (payload, spaces= undefined)=> {
|
|
|
2260
2264
|
// and their remote presences in the first place.
|
|
2261
2265
|
return `[${val[toStringTagSymbol]}]`;
|
|
2262
2266
|
}
|
|
2263
|
-
|
|
2267
|
+
if( isArray(val)) {
|
|
2268
|
+
return val;
|
|
2269
|
+
}
|
|
2270
|
+
const names= keys(val);
|
|
2271
|
+
if( names.length< 2) {
|
|
2272
|
+
return val;
|
|
2273
|
+
}
|
|
2274
|
+
let sorted= true;
|
|
2275
|
+
for( let i= 1; i< names.length; i+= 1) {
|
|
2276
|
+
if( names[i- 1]>= names[i]) {
|
|
2277
|
+
sorted= false;
|
|
2278
|
+
break;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
if( sorted) {
|
|
2282
|
+
return val;
|
|
2283
|
+
}
|
|
2284
|
+
arraySort(names);
|
|
2285
|
+
const entries= arrayMap(names, (name)=>[name, val[name]]);
|
|
2286
|
+
return fromEntries(entries);
|
|
2264
2287
|
}
|
|
2265
2288
|
case 'function': {
|
|
2266
2289
|
return `[Function ${val.name|| '<anon>' }]`;
|
|
@@ -5679,7 +5702,7 @@ const evadeHtmlCommentTest= (src)=>{
|
|
|
5679
5702
|
// /////////////////////////////////////////////////////////////////////////////
|
|
5680
5703
|
$h_once.evadeHtmlCommentTest(evadeHtmlCommentTest);
|
|
5681
5704
|
const importPattern= new FERAL_REG_EXP(
|
|
5682
|
-
'(^|[^.])\\bimport(\\s*(?:\\(|/[/*]))',
|
|
5705
|
+
'(^|[^.]|\\.\\.\\.)\\bimport(\\s*(?:\\(|/[/*]))',
|
|
5683
5706
|
'g');
|
|
5684
5707
|
|
|
5685
5708
|
|
package/dist/lockdown.umd.js
CHANGED
|
@@ -1204,6 +1204,7 @@ const permitted= {
|
|
|
1204
1204
|
dotAll: getter,
|
|
1205
1205
|
flags: getter,
|
|
1206
1206
|
global: getter,
|
|
1207
|
+
hasIndices: getter,
|
|
1207
1208
|
ignoreCase: getter,
|
|
1208
1209
|
'@@match': fn,
|
|
1209
1210
|
'@@matchAll': fn,
|
|
@@ -1216,13 +1217,11 @@ const permitted= {
|
|
|
1216
1217
|
test: fn,
|
|
1217
1218
|
toString: fn,
|
|
1218
1219
|
unicode: getter,
|
|
1220
|
+
unicodeSets: getter,
|
|
1219
1221
|
|
|
1220
1222
|
// Annex B: Additional Properties of the RegExp.prototype Object
|
|
1221
|
-
compile: false
|
|
1222
|
-
|
|
1223
|
-
// Safari Tech Preview Release 122 (Safari 14.2, WebKit 16612.1.6.2)
|
|
1224
|
-
hasIndices: false},
|
|
1225
|
-
|
|
1223
|
+
compile: false // UNSAFE and suppressed.
|
|
1224
|
+
},
|
|
1226
1225
|
|
|
1227
1226
|
'%RegExpStringIteratorPrototype%': {
|
|
1228
1227
|
// The %RegExpStringIteratorPrototype% Object
|
|
@@ -2138,7 +2137,12 @@ freeze(makeEnvironmentCaptor);
|
|
|
2138
2137
|
})
|
|
2139
2138
|
,
|
|
2140
2139
|
// === functors[6] ===
|
|
2141
|
-
(({ imports: $h_imports, liveVar: $h_live, onceVar: $h_once, importMeta: $h____meta, }) => { let Set,String,arrayJoin,arraySlice,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h_imports([["../commons.js", [["Set", [$h_a => (Set = $h_a)]],["String", [$h_a => (String = $h_a)]],["arrayJoin", [$h_a => (arrayJoin = $h_a)]],["arraySlice", [$h_a => (arraySlice = $h_a)]],["freeze", [$h_a => (freeze = $h_a)]],["is", [$h_a => (is = $h_a)]],["isError", [$h_a => (isError = $h_a)]],["setAdd", [$h_a => (setAdd = $h_a)]],["setHas", [$h_a => (setHas = $h_a)]],["stringIncludes", [$h_a => (stringIncludes = $h_a)]],["stringStartsWith", [$h_a => (stringStartsWith = $h_a)]],["stringifyJson", [$h_a => (stringifyJson = $h_a)]],["toStringTagSymbol", [$h_a => (toStringTagSymbol = $h_a)]]]]]);
|
|
2140
|
+
(({ imports: $h_imports, liveVar: $h_live, onceVar: $h_once, importMeta: $h____meta, }) => { let Set,String,isArray,arrayJoin,arraySlice,arraySort,arrayMap,keys,fromEntries,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h_imports([["../commons.js", [["Set", [$h_a => (Set = $h_a)]],["String", [$h_a => (String = $h_a)]],["isArray", [$h_a => (isArray = $h_a)]],["arrayJoin", [$h_a => (arrayJoin = $h_a)]],["arraySlice", [$h_a => (arraySlice = $h_a)]],["arraySort", [$h_a => (arraySort = $h_a)]],["arrayMap", [$h_a => (arrayMap = $h_a)]],["keys", [$h_a => (keys = $h_a)]],["fromEntries", [$h_a => (fromEntries = $h_a)]],["freeze", [$h_a => (freeze = $h_a)]],["is", [$h_a => (is = $h_a)]],["isError", [$h_a => (isError = $h_a)]],["setAdd", [$h_a => (setAdd = $h_a)]],["setHas", [$h_a => (setHas = $h_a)]],["stringIncludes", [$h_a => (stringIncludes = $h_a)]],["stringStartsWith", [$h_a => (stringStartsWith = $h_a)]],["stringifyJson", [$h_a => (stringifyJson = $h_a)]],["toStringTagSymbol", [$h_a => (toStringTagSymbol = $h_a)]]]]]);
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2142
2146
|
|
|
2143
2147
|
|
|
2144
2148
|
|
|
@@ -2260,7 +2264,26 @@ const bestEffortStringify= (payload, spaces= undefined)=> {
|
|
|
2260
2264
|
// and their remote presences in the first place.
|
|
2261
2265
|
return `[${val[toStringTagSymbol]}]`;
|
|
2262
2266
|
}
|
|
2263
|
-
|
|
2267
|
+
if( isArray(val)) {
|
|
2268
|
+
return val;
|
|
2269
|
+
}
|
|
2270
|
+
const names= keys(val);
|
|
2271
|
+
if( names.length< 2) {
|
|
2272
|
+
return val;
|
|
2273
|
+
}
|
|
2274
|
+
let sorted= true;
|
|
2275
|
+
for( let i= 1; i< names.length; i+= 1) {
|
|
2276
|
+
if( names[i- 1]>= names[i]) {
|
|
2277
|
+
sorted= false;
|
|
2278
|
+
break;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
if( sorted) {
|
|
2282
|
+
return val;
|
|
2283
|
+
}
|
|
2284
|
+
arraySort(names);
|
|
2285
|
+
const entries= arrayMap(names, (name)=>[name, val[name]]);
|
|
2286
|
+
return fromEntries(entries);
|
|
2264
2287
|
}
|
|
2265
2288
|
case 'function': {
|
|
2266
2289
|
return `[Function ${val.name|| '<anon>' }]`;
|
|
@@ -5679,7 +5702,7 @@ const evadeHtmlCommentTest= (src)=>{
|
|
|
5679
5702
|
// /////////////////////////////////////////////////////////////////////////////
|
|
5680
5703
|
$h_once.evadeHtmlCommentTest(evadeHtmlCommentTest);
|
|
5681
5704
|
const importPattern= new FERAL_REG_EXP(
|
|
5682
|
-
'(^|[^.])\\bimport(\\s*(?:\\(|/[/*]))',
|
|
5705
|
+
'(^|[^.]|\\.\\.\\.)\\bimport(\\s*(?:\\(|/[/*]))',
|
|
5683
5706
|
'g');
|
|
5684
5707
|
|
|
5685
5708
|
|