@agoric/xsnap-lockdown 0.14.1-upgrade-14-dev-c8f9e7b.0 → 0.14.1-upgrade-16-dev-8879538.0
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/README.md +1 -1
- package/dist/lockdown-debug.bundle +1 -1
- package/dist/lockdown-debug.bundle.sha256 +1 -1
- package/dist/lockdown.bundle +1 -1
- package/dist/lockdown.bundle.sha256 +1 -1
- package/dist/src-object-inspect.js +1 -1
- package/lib/object-inspect.js +6 -6
- package/lib/ses-boot-debug.js +1 -1
- package/lib/ses-boot.js +1 -1
- package/package.json +16 -9
- package/CHANGELOG.md +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
93aa2eef2f016ab0590b87bebd621757468bfe18132f28f70728c17dcf621844
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var objectInspect = "// @ts-nocheck\n/* eslint-disable no-empty,no-nested-ternary,no-use-before-define */\n/* eslint-enable @endo/no-polymorphic-call */\n/* global globalThis */\n// Adapted from object-inspect@1.12.0 https://github.com/inspect-js/object-inspect\n/*\nMIT License\n\nCopyright (c) 2013 James Halliday\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\nconst mapSize = Object.getOwnPropertyDescriptor(Map.prototype, 'size').get;\nconst mapForEach = Map.prototype.forEach;\nconst setSize = Object.getOwnPropertyDescriptor(Set.prototype, 'size').get;\nconst setForEach = Set.prototype.forEach;\nconst WeakRefPrototype =\n typeof globalThis.WeakRef === 'function' ? globalThis.WeakRef.prototype : {};\nconst booleanValueOf = Boolean.prototype.valueOf;\nconst objectToString = Object.prototype.toString;\nconst functionToString = Function.prototype.toString;\nconst $match = String.prototype.match;\nconst $slice = String.prototype.slice;\nconst $replace = String.prototype.replace;\nconst $toUpperCase = String.prototype.toUpperCase;\nconst $test = RegExp.prototype.test;\nconst $concat = Array.prototype.concat;\nconst $join = Array.prototype.join;\nconst bigIntValueOf = BigInt.prototype.valueOf;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst symToString = Symbol.prototype.toString;\nconst symKeyFor = Symbol.keyFor;\n// ie, `has-tostringtag/shams\nconst toStringTag = Symbol.toStringTag;\nconst isEnumerable = Object.prototype.propertyIsEnumerable;\nconst dateToISOString = Date.prototype.toISOString;\n\nconst gPO = Reflect.getPrototypeOf;\nconst hasOwn = Object.prototype.hasOwnProperty;\n\n// Separate every three rightmost digits.\nconst separateDigits = (\n digits,\n separator = '_',\n separationRegExp = /^-?\\d+(\\d{3})$/,\n) => {\n const separations = [];\n let match;\n // eslint-disable-next-line no-cond-assign\n while ((match = digits.match(separationRegExp))) {\n separations.unshift(match[1]);\n digits = digits.slice(0, -match[1].length);\n }\n separations.unshift(digits);\n return $join.call(separations, separator);\n};\n\nfunction inspect0(obj, opts = {}, depth = 0, circular = new Set()) {\n // Handle enumerable primitives.\n if (obj == null) {\n return obj === null ? 'null' : 'undefined';\n }\n if (obj === true) {\n return 'true';\n }\n if (obj === false) {\n return 'false';\n }\n\n const typeofObj = typeof obj;\n if (typeofObj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeofObj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n return String(obj);\n }\n if (typeofObj === 'bigint') {\n // Separate the digits to help visualise, terminate with `n`.\n return `${separateDigits(String(obj))}n`;\n }\n\n const maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (depth >= maxDepth && maxDepth > 0 && typeofObj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n const indent = getIndent(opts, depth);\n\n if (circular.has(obj)) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n circular.add(from);\n }\n let ret;\n if (noIndent) {\n const newOpts = {\n depth: opts.depth,\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n ret = inspect0(value, newOpts, depth + 1, circular);\n } else {\n ret = inspect0(value, opts, depth + 1, circular);\n }\n if (from) {\n circular.delete(from);\n }\n return ret;\n }\n\n if (typeofObj === 'function') {\n const name = nameOf(obj);\n const keys = arrObjKeys(obj, inspect);\n return `[Function${name ? `: ${name}` : ' (anonymous)'}]${\n keys.length > 0 ? ` { ${$join.call(keys, ', ')} }` : ''\n }`;\n }\n if (isSymbol(obj)) {\n const registered = symKeyFor(obj);\n if (registered !== undefined) {\n // Registered symbol.\n return `Symbol.for(${registered})`;\n }\n return symToString.call(obj);\n }\n if (typeof obj !== 'object') {\n // Some new unknown type\n return typeof obj;\n }\n\n if (isArray(obj)) {\n if (obj.length === 0) {\n return '[]';\n }\n const elems = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(elems)) {\n return `[${indentedJoin(elems, indent)}]`;\n }\n return `[ ${$join.call(elems, ', ')} ]`;\n }\n if (isError(obj)) {\n const parts = arrObjKeys(obj, inspect);\n if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {\n parts.unshift(`[cause]: ${inspect(obj.cause)}`);\n }\n if (parts.length === 0) {\n return `[${String(obj)}]`;\n }\n return `{ [${String(obj)}] ${$join.call(parts, ', ')} }`;\n }\n\n const objProto = gPO(obj);\n switch (objProto) {\n case Map.prototype: {\n const mapParts = [];\n mapForEach.call(obj, (value, key) => {\n mapParts.push(`${inspect(key, obj, true)} => ${inspect(value, obj)}`);\n });\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n case Set.prototype: {\n const setParts = [];\n setForEach.call(obj, value => {\n setParts.push(inspect(value, obj));\n });\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n case WeakMap.prototype: {\n return weakContainerOf('WeakMap');\n }\n case WeakSet.prototype: {\n return weakContainerOf('WeakSet');\n }\n case WeakRefPrototype: {\n return weakContainerOf('WeakRef');\n }\n case BigInt.prototype: {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n default:\n // Fall-through\n }\n\n if (!(toStringTag in obj)) {\n switch (objProto) {\n case Number.prototype: {\n return markBoxed(inspect(Number(obj)));\n }\n case Boolean.prototype: {\n return markBoxed(booleanValueOf.call(obj));\n }\n case String.prototype: {\n return markBoxed(inspect(String(obj)));\n }\n case Date.prototype: {\n return dateToISOString.call(obj);\n }\n case RegExp.prototype: {\n return String(obj);\n }\n default:\n // Fall-through\n }\n }\n\n const elems = arrObjKeys(obj, inspect);\n const isPlainObject = objProto === Object.prototype;\n const protoTag =\n isPlainObject || obj instanceof Object ? '' : 'null prototype';\n const stringTag =\n !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj\n ? $slice.call(toStr(obj), 8, -1)\n : protoTag\n ? 'Object'\n : '';\n const protoConstructor = objProto && objProto.constructor;\n const constructorTag =\n isPlainObject || typeof protoConstructor !== 'function'\n ? ''\n : protoConstructor.name\n ? `${protoConstructor.name} `\n : '';\n const tag =\n constructorTag +\n (stringTag || protoTag\n ? `[${$join.call(\n $concat.call([], stringTag || [], protoTag || []),\n ': ',\n )}] `\n : '');\n if (elems.length === 0) {\n return `${tag}{}`;\n }\n if (indent) {\n return `${tag}{${indentedJoin(elems, indent)}}`;\n }\n return `${tag}{ ${$join.call(elems, ', ')} }`;\n}\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n const quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction isArray(obj) {\n return (\n Array.isArray(obj) &&\n (!toStringTag || !(typeof obj === 'object' && toStringTag in obj))\n );\n}\nfunction isError(obj) {\n return (\n obj instanceof Error && !(typeof obj === 'object' && toStringTag in obj)\n );\n}\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n return typeof obj === 'symbol';\n}\n\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) {\n return f.name;\n }\n const m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) {\n return m[1];\n }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) {\n return xs.indexOf(x);\n }\n for (let i = 0, l = xs.length; i < l; i += 1) {\n if (xs[i] === x) {\n return i;\n }\n }\n return -1;\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n const remaining = str.length - opts.maxStringLength;\n const trailer = `... ${remaining} more character${\n remaining > 1 ? 's' : ''\n }`;\n return (\n inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer\n );\n }\n const s = $replace.call(\n // Replace ' with \\' and \\ with \\\\.\n $replace.call(str, /(['\\\\])/g, '\\\\$1'),\n // eslint-disable-next-line no-control-regex\n /[\\x00-\\x1f]/g,\n lowbyte,\n );\n return wrapQuotes(s, 'single', opts);\n}\n\n// Replace control characters with `\\b`, `\\t`, `\\n`, `\\f`, `\\r`, `\\x0B` or\n// `\\xAB` escaped versions.\nfunction lowbyte(c) {\n const n = c.charCodeAt(0);\n const x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r',\n }[n];\n if (x) {\n return `\\\\${x}`;\n }\n return `\\\\x${n < 0x10 ? '0' : ''}${$toUpperCase.call(n.toString(16))}`;\n}\n\nfunction markBoxed(str) {\n return `Object(${str})`;\n}\n\nfunction weakContainerOf(type) {\n return `${type} { ? }`;\n}\n\nfunction collectionOf(type, size, entries, indent) {\n const joinedEntries = indent\n ? indentedJoin(entries, indent)\n : $join.call(entries, ', ');\n return `${type} (${size}) {${joinedEntries}}`;\n}\n\nfunction singleLineValues(xs) {\n for (let i = 0; i < xs.length; i += 1) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n let baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent),\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) {\n return '';\n }\n const lineJoiner = `\\n${indent.prev}${indent.base}`;\n return `${lineJoiner + $join.call(xs, `,${lineJoiner}`)}\\n${indent.prev}`;\n}\n\nfunction arrObjKeys(obj, inspect) {\n const isArr = isArray(obj);\n const elems = [];\n if (isArr) {\n elems.length = obj.length;\n for (let i = 0; i < obj.length; i += 1) {\n elems[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n const syms = getOwnPropertySymbols(obj);\n for (const key of getOwnPropertyNames(obj)) {\n if (!isEnumerable.call(obj, key)) {\n continue;\n }\n if (isArr && String(Number(key)) === key && key < obj.length) {\n continue;\n }\n if ($test.call(/[^\\w$]/, key)) {\n elems.push(`${inspect(key, obj)}: ${inspect(obj[key], obj)}`);\n } else {\n elems.push(`${key}: ${inspect(obj[key], obj)}`);\n }\n }\n for (let j = 0; j < syms.length; j += 1) {\n if (isEnumerable.call(obj, syms[j])) {\n elems.push(`[${inspect(syms[j])}]: ${inspect(obj[syms[j]], obj)}`);\n }\n }\n return elems;\n}\n\nconst outerInspect = (obj, ...args) => {\n try {\n return inspect0(obj, ...args);\n } catch (err) {\n let errStr;\n try {\n errStr = inspect0(err);\n } catch (_) {\n errStr = 'throw';\n }\n return `[cannot inspect (${typeof obj}) due to ${errStr}]`;\n }\n};\n\n// This must be the only import/export statement, and occur last in the file, so\n// that confined-object-inspect.js can comment out the `export default`\n// and evaluate this entire file's source code to obtain the inspector as the\n// completion value.\nexport default harden(outerInspect);\n";
|
|
1
|
+
var objectInspect = "// @ts-nocheck\n/* eslint-disable no-nested-ternary,no-use-before-define */\n\n/* global globalThis */\n// Adapted from object-inspect@1.12.0 https://github.com/inspect-js/object-inspect\n/*\nMIT License\n\nCopyright (c) 2013 James Halliday\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\nconst mapSize = Object.getOwnPropertyDescriptor(Map.prototype, 'size').get;\nconst mapForEach = Map.prototype.forEach;\nconst setSize = Object.getOwnPropertyDescriptor(Set.prototype, 'size').get;\nconst setForEach = Set.prototype.forEach;\nconst WeakRefPrototype =\n typeof globalThis.WeakRef === 'function' ? globalThis.WeakRef.prototype : {};\nconst booleanValueOf = Boolean.prototype.valueOf;\nconst objectToString = Object.prototype.toString;\nconst functionToString = Function.prototype.toString;\nconst $match = String.prototype.match;\nconst $slice = String.prototype.slice;\nconst $replace = String.prototype.replace;\nconst $toUpperCase = String.prototype.toUpperCase;\nconst $test = RegExp.prototype.test;\nconst $concat = Array.prototype.concat;\nconst $join = Array.prototype.join;\nconst bigIntValueOf = BigInt.prototype.valueOf;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst symToString = Symbol.prototype.toString;\nconst symKeyFor = Symbol.keyFor;\n// ie, `has-tostringtag/shams\nconst toStringTag = Symbol.toStringTag;\nconst isEnumerable = Object.prototype.propertyIsEnumerable;\nconst dateToISOString = Date.prototype.toISOString;\n\nconst gPO = Reflect.getPrototypeOf;\nconst hasOwn = Object.prototype.hasOwnProperty;\n\n// Separate every three rightmost digits.\nconst separateDigits = (\n digits,\n separator = '_',\n separationRegExp = /^-?\\d+(\\d{3})$/,\n) => {\n const separations = [];\n let match;\n // eslint-disable-next-line no-cond-assign\n while ((match = digits.match(separationRegExp))) {\n separations.unshift(match[1]);\n digits = digits.slice(0, -match[1].length);\n }\n separations.unshift(digits);\n return $join.call(separations, separator);\n};\n\nfunction inspect0(obj, opts = {}, depth = 0, circular = new Set()) {\n // Handle enumerable primitives.\n if (obj == null) {\n return obj === null ? 'null' : 'undefined';\n }\n if (obj === true) {\n return 'true';\n }\n if (obj === false) {\n return 'false';\n }\n\n const typeofObj = typeof obj;\n if (typeofObj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeofObj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n return String(obj);\n }\n if (typeofObj === 'bigint') {\n // Separate the digits to help visualise, terminate with `n`.\n return `${separateDigits(String(obj))}n`;\n }\n\n const maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (depth >= maxDepth && maxDepth > 0 && typeofObj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n const indent = getIndent(opts, depth);\n\n if (circular.has(obj)) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n circular.add(from);\n }\n let ret;\n if (noIndent) {\n const newOpts = {\n depth: opts.depth,\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n ret = inspect0(value, newOpts, depth + 1, circular);\n } else {\n ret = inspect0(value, opts, depth + 1, circular);\n }\n if (from) {\n circular.delete(from);\n }\n return ret;\n }\n\n if (typeofObj === 'function') {\n const name = nameOf(obj);\n const keys = arrObjKeys(obj, inspect);\n return `[Function${name ? `: ${name}` : ' (anonymous)'}]${\n keys.length > 0 ? ` { ${$join.call(keys, ', ')} }` : ''\n }`;\n }\n if (isSymbol(obj)) {\n const registered = symKeyFor(obj);\n if (registered !== undefined) {\n // Registered symbol.\n return `Symbol.for(${registered})`;\n }\n return symToString.call(obj);\n }\n if (typeof obj !== 'object') {\n // Some new unknown type\n return typeof obj;\n }\n\n if (isArray(obj)) {\n if (obj.length === 0) {\n return '[]';\n }\n const elems = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(elems)) {\n return `[${indentedJoin(elems, indent)}]`;\n }\n return `[ ${$join.call(elems, ', ')} ]`;\n }\n if (isError(obj)) {\n const parts = arrObjKeys(obj, inspect);\n if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {\n parts.unshift(`[cause]: ${inspect(obj.cause)}`);\n }\n if (parts.length === 0) {\n return `[${String(obj)}]`;\n }\n return `{ [${String(obj)}] ${$join.call(parts, ', ')} }`;\n }\n\n const objProto = gPO(obj);\n switch (objProto) {\n case Map.prototype: {\n const mapParts = [];\n mapForEach.call(obj, (value, key) => {\n mapParts.push(`${inspect(key, obj, true)} => ${inspect(value, obj)}`);\n });\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n case Set.prototype: {\n const setParts = [];\n setForEach.call(obj, value => {\n setParts.push(inspect(value, obj));\n });\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n case WeakMap.prototype: {\n return weakContainerOf('WeakMap');\n }\n case WeakSet.prototype: {\n return weakContainerOf('WeakSet');\n }\n case WeakRefPrototype: {\n return weakContainerOf('WeakRef');\n }\n case BigInt.prototype: {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n default:\n // Fall-through\n }\n\n if (!(toStringTag in obj)) {\n switch (objProto) {\n case Number.prototype: {\n return markBoxed(inspect(Number(obj)));\n }\n case Boolean.prototype: {\n return markBoxed(booleanValueOf.call(obj));\n }\n case String.prototype: {\n return markBoxed(inspect(String(obj)));\n }\n case Date.prototype: {\n return dateToISOString.call(obj);\n }\n case RegExp.prototype: {\n return String(obj);\n }\n default:\n // Fall-through\n }\n }\n\n const elems = arrObjKeys(obj, inspect);\n const isPlainObject = objProto === Object.prototype;\n const protoTag =\n isPlainObject || obj instanceof Object ? '' : 'null prototype';\n const stringTag =\n !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj\n ? $slice.call(toStr(obj), 8, -1)\n : protoTag\n ? 'Object'\n : '';\n const protoConstructor = objProto && objProto.constructor;\n const constructorTag =\n isPlainObject || typeof protoConstructor !== 'function'\n ? ''\n : protoConstructor.name\n ? `${protoConstructor.name} `\n : '';\n const tag =\n constructorTag +\n (stringTag || protoTag\n ? `[${$join.call(\n $concat.call([], stringTag || [], protoTag || []),\n ': ',\n )}] `\n : '');\n if (elems.length === 0) {\n return `${tag}{}`;\n }\n if (indent) {\n return `${tag}{${indentedJoin(elems, indent)}}`;\n }\n return `${tag}{ ${$join.call(elems, ', ')} }`;\n}\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n const quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction isArray(obj) {\n return (\n Array.isArray(obj) &&\n (!toStringTag || !(typeof obj === 'object' && toStringTag in obj))\n );\n}\nfunction isError(obj) {\n return (\n obj instanceof Error && !(typeof obj === 'object' && toStringTag in obj)\n );\n}\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n return typeof obj === 'symbol';\n}\n\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) {\n return f.name;\n }\n const m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) {\n return m[1];\n }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) {\n return xs.indexOf(x);\n }\n for (let i = 0, l = xs.length; i < l; i += 1) {\n if (xs[i] === x) {\n return i;\n }\n }\n return -1;\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n const remaining = str.length - opts.maxStringLength;\n const trailer = `... ${remaining} more character${\n remaining > 1 ? 's' : ''\n }`;\n return (\n inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer\n );\n }\n const s = $replace.call(\n // Replace ' with \\' and \\ with \\\\.\n $replace.call(str, /(['\\\\])/g, '\\\\$1'),\n // eslint-disable-next-line no-control-regex\n /[\\x00-\\x1f]/g,\n lowbyte,\n );\n return wrapQuotes(s, 'single', opts);\n}\n\n// Replace control characters with `\\b`, `\\t`, `\\n`, `\\f`, `\\r`, `\\x0B` or\n// `\\xAB` escaped versions.\nfunction lowbyte(c) {\n const n = c.charCodeAt(0);\n const x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r',\n }[n];\n if (x) {\n return `\\\\${x}`;\n }\n return `\\\\x${n < 0x10 ? '0' : ''}${$toUpperCase.call(n.toString(16))}`;\n}\n\nfunction markBoxed(str) {\n return `Object(${str})`;\n}\n\nfunction weakContainerOf(type) {\n return `${type} { ? }`;\n}\n\nfunction collectionOf(type, size, entries, indent) {\n const joinedEntries = indent\n ? indentedJoin(entries, indent)\n : $join.call(entries, ', ');\n return `${type} (${size}) {${joinedEntries}}`;\n}\n\nfunction singleLineValues(xs) {\n for (let i = 0; i < xs.length; i += 1) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n let baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent),\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) {\n return '';\n }\n const lineJoiner = `\\n${indent.prev}${indent.base}`;\n return `${lineJoiner + $join.call(xs, `,${lineJoiner}`)}\\n${indent.prev}`;\n}\n\nfunction arrObjKeys(obj, inspect) {\n const isArr = isArray(obj);\n const elems = [];\n if (isArr) {\n elems.length = obj.length;\n for (let i = 0; i < obj.length; i += 1) {\n elems[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n const syms = getOwnPropertySymbols(obj);\n for (const key of getOwnPropertyNames(obj)) {\n if (!isEnumerable.call(obj, key)) {\n continue;\n }\n if (isArr && String(Number(key)) === key && key < obj.length) {\n continue;\n }\n if ($test.call(/[^\\w$]/, key)) {\n elems.push(`${inspect(key, obj)}: ${inspect(obj[key], obj)}`);\n } else {\n elems.push(`${key}: ${inspect(obj[key], obj)}`);\n }\n }\n for (let j = 0; j < syms.length; j += 1) {\n if (isEnumerable.call(obj, syms[j])) {\n elems.push(`[${inspect(syms[j])}]: ${inspect(obj[syms[j]], obj)}`);\n }\n }\n return elems;\n}\n\nconst outerInspect = (obj, ...args) => {\n try {\n return inspect0(obj, ...args);\n } catch (err) {\n let errStr;\n try {\n errStr = inspect0(err);\n } catch (_) {\n errStr = 'throw';\n }\n return `[cannot inspect (${typeof obj}) due to ${errStr}]`;\n }\n};\n\n// This must be the only import/export statement, and occur last in the file, so\n// that confined-object-inspect.js can comment out the `export default`\n// and evaluate this entire file's source code to obtain the inspector as the\n// completion value.\nexport default harden(outerInspect);\n";
|
|
2
2
|
|
|
3
3
|
export { objectInspect as default };
|
package/lib/object-inspect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
/* eslint-disable no-
|
|
3
|
-
|
|
2
|
+
/* eslint-disable no-nested-ternary,no-use-before-define */
|
|
3
|
+
|
|
4
4
|
/* global globalThis */
|
|
5
5
|
// Adapted from object-inspect@1.12.0 https://github.com/inspect-js/object-inspect
|
|
6
6
|
/*
|
|
@@ -235,15 +235,15 @@ function inspect0(obj, opts = {}, depth = 0, circular = new Set()) {
|
|
|
235
235
|
!isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj
|
|
236
236
|
? $slice.call(toStr(obj), 8, -1)
|
|
237
237
|
: protoTag
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
? 'Object'
|
|
239
|
+
: '';
|
|
240
240
|
const protoConstructor = objProto && objProto.constructor;
|
|
241
241
|
const constructorTag =
|
|
242
242
|
isPlainObject || typeof protoConstructor !== 'function'
|
|
243
243
|
? ''
|
|
244
244
|
: protoConstructor.name
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
? `${protoConstructor.name} `
|
|
246
|
+
: '';
|
|
247
247
|
const tag =
|
|
248
248
|
constructorTag +
|
|
249
249
|
(stringTag || protoTag
|
package/lib/ses-boot-debug.js
CHANGED
package/lib/ses-boot.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/xsnap-lockdown",
|
|
3
|
-
"version": "0.14.1-upgrade-
|
|
3
|
+
"version": "0.14.1-upgrade-16-dev-8879538.0+8879538",
|
|
4
4
|
"description": "Endo/lockdown initialization bundle for xsnap workers",
|
|
5
5
|
"author": "Agoric",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"lint": "run-s --continue-on-error lint:*",
|
|
15
15
|
"lint:js": "eslint 'src/**/*.js' 'lib/**/*.js' 'scripts/**/*.js' 'test/**/*.js'",
|
|
16
|
-
"lint:types": "tsc
|
|
16
|
+
"lint:types": "tsc",
|
|
17
17
|
"lint-fix": "eslint --fix 'src/**/*.js' 'lib/**/*.js' 'scripts/**/*.js' 'test/**/*.js'",
|
|
18
18
|
"test": "ava",
|
|
19
19
|
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
|
|
20
20
|
"test:xs": "exit 0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@endo/bundle-source": "2.
|
|
24
|
-
"@endo/init": "
|
|
25
|
-
"ava": "^5.
|
|
26
|
-
"c8": "^
|
|
23
|
+
"@endo/bundle-source": "^3.2.3",
|
|
24
|
+
"@endo/init": "^1.1.2",
|
|
25
|
+
"ava": "^5.3.0",
|
|
26
|
+
"c8": "^9.1.0",
|
|
27
27
|
"rollup": "^2.58.0",
|
|
28
|
-
"rollup-plugin-string": "^3.0.0"
|
|
28
|
+
"rollup-plugin-string": "^3.0.0",
|
|
29
|
+
"source-map": "^0.7.4"
|
|
29
30
|
},
|
|
30
31
|
"files": [
|
|
31
32
|
"LICENSE*",
|
|
@@ -38,10 +39,16 @@
|
|
|
38
39
|
},
|
|
39
40
|
"ava": {
|
|
40
41
|
"files": [
|
|
41
|
-
"test
|
|
42
|
+
"test/**/*.test.*"
|
|
43
|
+
],
|
|
44
|
+
"require": [
|
|
45
|
+
"@endo/init/debug.js"
|
|
42
46
|
],
|
|
43
47
|
"timeout": "2m",
|
|
44
48
|
"workerThreads": false
|
|
45
49
|
},
|
|
46
|
-
"
|
|
50
|
+
"typeCoverage": {
|
|
51
|
+
"atLeast": 73.6
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "8879538cd1d125a08346f02dd5701d0d70c90bb8"
|
|
47
54
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
### [0.14.1-u13.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/xsnap-lockdown@0.14.1-u11wf.0...@agoric/xsnap-lockdown@0.14.1-u13.0) (2023-12-07)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @agoric/xsnap-lockdown
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### [0.14.1-u11wf.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/xsnap-lockdown@0.14.0...@agoric/xsnap-lockdown@0.14.1-u11wf.0) (2023-09-23)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @agoric/xsnap-lockdown
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## 0.14.0 (2023-05-19)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Features
|
|
26
|
-
|
|
27
|
-
* create new xsnap-lockdown package ([2af831d](https://github.com/Agoric/agoric-sdk/commit/2af831d9683a4080168ee267e8d57227d2167f37)), closes [#6596](https://github.com/Agoric/agoric-sdk/issues/6596)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Bug Fixes
|
|
31
|
-
|
|
32
|
-
* **xsnap-lockdown:** inspect should not throw ([8d54bdd](https://github.com/Agoric/agoric-sdk/commit/8d54bdd19abc3098b92d02f266f883dcb637bf05))
|
|
33
|
-
* Stop doing object-inspect type checks the hard way ([087aa27](https://github.com/Agoric/agoric-sdk/commit/087aa27f2dfd6444e4cc969956c621b3bf581940)), closes [#7277](https://github.com/Agoric/agoric-sdk/issues/7277)
|
|
34
|
-
* **xsnap-lockdown:** change the API to get hash of the lockdown bundle ([#7222](https://github.com/Agoric/agoric-sdk/issues/7222)) ([173185e](https://github.com/Agoric/agoric-sdk/commit/173185e47154c12e025bc38478283087439058f9))
|