Socket
Socket
Sign inDemoInstall

ses

Package Overview
Dependencies
Maintainers
6
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ses - npm Package Compare versions

Comparing version 0.18.1 to 0.18.2

tools.js

1

index.js

@@ -29,2 +29,3 @@ // Copyright (C) 2018 Agoric

if (getThis()) {
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_SLOPPY.md
throw new TypeError(`SES failed to initialize, sloppy mode (SES_NO_SLOPPY)`);

@@ -31,0 +32,0 @@ }

User-visible changes in SES:
# v0.18.2 (2023-03-07)
- Introduces the `__syncModuleFunctor__` property of static module record
to replace evauluation of `__syncModuleProgram__` for environments without eval.
# v0.18.1 (2022-12-23)

@@ -4,0 +9,0 @@

24

package.json
{
"name": "ses",
"version": "0.18.1",
"version": "0.18.2",
"description": "Hardened JavaScript for Fearless Cooperation",

@@ -35,3 +35,3 @@ "keywords": [

"unpkg": "./dist/ses.umd.js",
"types": "./index.d.ts",
"types": "./types.d.ts",
"exports": {

@@ -46,2 +46,3 @@ ".": {

},
"./tools.js": "./tools.js",
"./package.json": "./package.json"

@@ -64,7 +65,7 @@ },

"devDependencies": {
"@endo/compartment-mapper": "^0.8.1",
"@endo/eslint-config": "^0.5.2",
"@endo/static-module-record": "^0.7.16",
"@endo/test262-runner": "^0.1.29",
"ava": "^5.1.0",
"@endo/compartment-mapper": "^0.8.2",
"@endo/eslint-config": "^0.5.3",
"@endo/static-module-record": "^0.7.17",
"@endo/test262-runner": "^0.1.30",
"ava": "^5.2.0",
"babel-eslint": "^10.0.3",

@@ -76,3 +77,3 @@ "c8": "^7.7.3",

"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^3.4.1",

@@ -83,3 +84,3 @@ "prettier": "^2.8.0",

"tsd": "^0.24.1",
"typescript": "~4.8.4"
"typescript": "~4.9.5"
},

@@ -91,4 +92,5 @@ "files": [

"dist",
"index.d.ts",
"types.d.ts",
"index.js",
"tools.js",
"src"

@@ -189,3 +191,3 @@ ],

},
"gitHead": "ab8d64ae6fc9c628a2d1c02d16bf9ef249f5c8dc"
"gitHead": "0053227a37ee76ee8a3dce6059dd55140ed0ce6d"
}

@@ -444,2 +444,7 @@ # SES

corresponding value in another module.
- `__syncModuleFunctor__` is an optional function that if present is used
instead of the evaluation of the `__syncModuleProgram__` string. It will be
called with the initialization record described above. It is intended to be
used in environments where eval is not available. Sandboxing of the functor is
the responsibility of the author of the StaticModuleRecord.
- `__liveExportsMap__` is a record that maps import names or names in the lexical

@@ -529,3 +534,3 @@ scope of the module to export names, for variables that may change after

JavaScript realm.
In terms of the [Taxonomy of Security Issues](https://agoric.com/blog/all/taxonomy-of-security-issues/),
In terms of the [Taxonomy of Security Issues](https://papers.agoric.com/taxonomy-of-security-issues/),
the `ses` shim creates a boundary that is finer than an operating system

@@ -701,3 +706,3 @@ process or thread and facilitates boundaries as fine as individual objects.

report available on the
[Agoric blog](https://agoric.com/blog/technology/metamask-agoric-hardened-js-security-review/)
[Agoric blog](https://agoric.com/blog/technology/purple-teaming-how-metamask-and-agoric-hunted-bugs-to-harden-javascript)
that includes links to recordings of code walk-throughs and technical

@@ -712,7 +717,7 @@ discussion, and issues are tagged

In addition to vulnerability assessments, active efforts to [formally verify
the Agoric kernel](https://agoric.com/blog/technology/the-path-to-verified-blds-how-informal-systems-and-agoric-are-using-formal-methods-analysis-to-improve-software-integrity/)
the Agoric kernel](https://agoric.com/blog/technology/the-path-to-verified-blds-how-informal-systems-and-agoric-are-using-formal)
have found the object capability model that `ses` provides to be sound.
Hardened JavaScript is also within the scope of the [Agoric bug bounty
program](hackerone.com/agoric), which rewards researchers for surfacing valid
program](https://hackerone.com/agoric), which rewards researchers for surfacing valid
bugs in our code. We welcome the opportunity to cooperate with researchers,

@@ -719,0 +724,0 @@ whose efforts will undoubtedly yield stronger, more resilient code.

@@ -13,3 +13,3 @@ # Security Policy

* Reporting the issue to the [Agoric HackerOne vulnerability rewards program](hackerone.com/agoric).
* Reporting the issue to the [Agoric HackerOne vulnerability rewards program](https://hackerone.com/agoric).

@@ -16,0 +16,0 @@ * Sending an email to security at (@) agoric.com., encrypted or unencrypted. To encrypt, please use @Warner’s personal GPG key [A476E2E6 11880C98 5B3C3A39 0386E81B 11CAA07A](http://www.lothar.com/warner-gpg.html) .

@@ -100,2 +100,3 @@ /* global globalThis */

if (result !== object) {
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DEFINE_PROPERTY_FAILED_SILENTLY.md
throw TypeError(

@@ -283,2 +284,3 @@ `Please report that the original defineProperty silently failed to set ${stringifyJson(

export const noEvalEvaluate = () => {
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_EVAL.md
throw new TypeError(

@@ -285,0 +287,0 @@ 'Cannot eval with evalTaming set to "noEval" (SES_NO_EVAL)',

@@ -99,6 +99,6 @@ // @ts-check

* @param {string} source is a JavaScript program grammar construction.
* @param {Object} [options]
* @param {object} [options]
* @param {Array<Transform>} [options.transforms]
* @param {boolean} [options.sloppyGlobalsMode]
* @param {Object} [options.__moduleShimLexicals__]
* @param {object} [options.__moduleShimLexicals__]
* @param {boolean} [options.__evadeHtmlCommentTest__]

@@ -184,3 +184,3 @@ * @param {boolean} [options.__evadeImportExpressionTest__]

* @param {Record<string, any>} intrinsics
* @param {(object: Object) => void} markVirtualizedNativeFunction
* @param {(object: object) => void} markVirtualizedNativeFunction
* @returns {Compartment['constructor']}

@@ -187,0 +187,0 @@ */

@@ -209,2 +209,14 @@ /**

'%TypedArrayPrototype%': '*',
/**
* Needed to work with Immer before https://github.com/immerjs/immer/pull/914
* is accepted.
*/
'%MapPrototype%': '*',
/**
* Needed to work with Immer before https://github.com/immerjs/immer/pull/914
* is accepted.
*/
'%SetPrototype%': '*',
};

@@ -8,3 +8,3 @@ // @ts-check

const { details: X, Fail, quote: q } = assert;
const { Fail, quote: q } = assert;

@@ -59,3 +59,3 @@ /**

*
* @param {Object} aGlobal
* @param {object} aGlobal
*/

@@ -75,15 +75,9 @@ export const makeEnvironmentCaptor = aGlobal => {

// eslint-disable-next-line @endo/no-polymorphic-call
assert.typeof(
optionName,
'string',
X`Environment option name ${q(optionName)} must be a string.`,
);
typeof optionName === 'string' ||
Fail`Environment option name ${q(optionName)} must be a string.`;
// eslint-disable-next-line @endo/no-polymorphic-call
assert.typeof(
defaultSetting,
'string',
X`Environment option default setting ${q(
typeof defaultSetting === 'string' ||
Fail`Environment option default setting ${q(
defaultSetting,
)} must be a string.`,
);
)} must be a string.`;

@@ -100,11 +94,8 @@ /** @type {string} */

// eslint-disable-next-line @endo/no-polymorphic-call
assert.typeof(
optionValue,
'string',
X`Environment option named ${q(
typeof optionValue === 'string' ||
Fail`Environment option named ${q(
optionName,
)}, if present, must have a corresponding string value, got ${q(
optionValue,
)}`,
);
)}`;
setting = optionValue;

@@ -111,0 +102,0 @@ }

@@ -61,3 +61,3 @@ // Copyright (C) 2019 Agoric, under Apache License 2.0

/**
* @typedef {Object} HiddenDetails
* @typedef {object} HiddenDetails
*

@@ -366,5 +366,7 @@ * Captures the arguments passed to the `details` template string tag.

const details = unredacted ? unredactedDetails : redactedDetails;
const assertFailedDetails = details`Check failed`;
/** @type {AssertFail} */
const fail = (
optDetails = details`Assert failed`,
optDetails = assertFailedDetails,
ErrorConstructor = globalThis.Error,

@@ -389,8 +391,6 @@ ) => {

flag,
optDetails = details`Check failed`,
ErrorConstructor = globalThis.Error,
optDetails = undefined,
ErrorConstructor = undefined,
) {
if (!flag) {
throw fail(optDetails, ErrorConstructor);
}
flag || fail(optDetails, ErrorConstructor);
}

@@ -402,6 +402,10 @@

expected,
optDetails = details`Expected ${actual} is same as ${expected}`,
ErrorConstructor = RangeError,
optDetails = undefined,
ErrorConstructor = undefined,
) => {
baseAssert(is(actual, expected), optDetails, ErrorConstructor);
is(actual, expected) ||
fail(
optDetails || details`Expected ${actual} is same as ${expected}`,
ErrorConstructor || RangeError,
);
};

@@ -412,6 +416,10 @@ freeze(equal);

const assertTypeof = (specimen, typename, optDetails) => {
baseAssert(
typeof typename === 'string',
details`${quote(typename)} must be a string`,
);
// This will safely fall through if typename is not a string,
// which is what we want.
// eslint-disable-next-line valid-typeof
if (typeof specimen === typename) {
return;
}
typeof typename === 'string' || Fail`${quote(typename)} must be a string`;
if (optDetails === undefined) {

@@ -426,3 +434,3 @@ // Like

}
equal(typeof specimen, typename, optDetails, TypeError);
fail(optDetails, TypeError);
};

@@ -432,3 +440,3 @@ freeze(assertTypeof);

/** @type {AssertString} */
const assertString = (specimen, optDetails) =>
const assertString = (specimen, optDetails = undefined) =>
assertTypeof(specimen, 'string', optDetails);

@@ -435,0 +443,0 @@

@@ -28,3 +28,3 @@ // @ts-check

/**
* @typedef {Object} LoggedErrorHandler
* @typedef {object} LoggedErrorHandler
*

@@ -49,3 +49,3 @@ * Used to parameterize `makeCausalConsole` to give it access to potentially

/**
* @typedef {Object} LoggingConsoleKit
* @typedef {object} LoggingConsoleKit
* @property {VirtualConsole} loggingConsole

@@ -56,3 +56,3 @@ * @property {() => readonly LogRecord[]} takeLog

/**
* @typedef {Object} MakeLoggingConsoleKitOptions
* @typedef {object} MakeLoggingConsoleKitOptions
* @property {boolean=} shouldResetForDebugging

@@ -59,0 +59,0 @@ */

@@ -37,4 +37,5 @@ // @ts-check

*
* Fail an assertion, recording details to the console and
* raising an exception with just type information.
* Fail an assertion, recording full details to the console and
* raising an exception with a message in which `details` substitution values
* have been redacted.
*

@@ -145,2 +146,3 @@ * The optional `optDetails` can be a string for backwards compatibility

* @param {Details=} optDetails The details to throw
* @returns {asserts specimen is string}
*/

@@ -152,4 +154,4 @@

*
* Annotate this error with these details, potentially to be used by an
* augmented console, like the causal console of `console.js`, to
* Annotate an error with details, potentially to be used by an
* augmented console such as the causal console of `console.js`, to
* provide extra information associated with logged errors.

@@ -184,18 +186,12 @@ *

* To "declassify" and quote a substitution value used in a
* details`...` template literal, enclose that substitution expression
* in a call to `quote`. This states that the argument should appear quoted
* (as if with `JSON.stringify`), in the error message of the thrown error. The
* ``` details`...` ``` template literal, enclose that substitution expression
* in a call to `quote`. This makes the value appear quoted
* (as if with `JSON.stringify`) in the message of the thrown error. The
* payload itself is still passed unquoted to the console as it would be
* without `quote`.
*
* Starting from the example in the `details` comment, say instead that the
* color the sky is supposed to be is also computed. Say that we still don't
* want to reveal the sky's actual color, but we do want the thrown error's
* message to reveal what color the sky was supposed to be:
* For example, the following will reveal the expected sky color, but not the
* actual incorrect sky color, in the thrown error's message:
* ```js
* assert.equal(
* sky.color,
* color,
* details`${sky.color} should be ${quote(color)}`,
* );
* sky.color === expectedColor || Fail`${sky.color} should be ${quote(expectedColor)}`;
* ```

@@ -205,15 +201,7 @@ *

* // renamed to `X` rather than `d`.
* The normal convention is to locally rename `quote` to `q` and
* `details` to `d`
* The normal convention is to locally rename `details` to `d` and `quote` to `q`
* like `const { details: d, quote: q } = assert;`, so the above example would then be
* ```js
* const { details: d, quote: q } = assert;
* sky.color === expectedColor || Fail`${sky.color} should be ${q(expectedColor)}`;
* ```
* so the above example would then be
* ```js
* assert.equal(
* sky.color,
* color,
* d`${sky.color} should be ${q(color)}`,
* );
* ```
*

@@ -269,13 +257,28 @@ * @callback AssertQuote

* ```
* // TODO Update SES-shim to new convention, where `details` is
* // renamed to `X` rather than `d`.
* or following the normal convention to locally rename `details` to `d`
* and `quote` to `q` like `const { details: d, quote: q } = assert;`:
* ```js
* assert(sky.isBlue(), d`${sky.color} should be "blue"`);
* ```
* However, note that in most cases it is preferable to instead use the `Fail`
* template literal tag (which has the same input signature as `details`
* but automatically creates and throws an error):
* ```js
* sky.isBlue() || Fail`${sky.color} should be "blue"`;
* ```
*
* The details template tag returns a `DetailsToken` object that can print
* itself with the formatted message in two ways.
* It will report the real details to
* the console but include only the typeof information in the thrown error
* It will report full details to the console, but
* mask embedded substitution values with their typeof information in the thrown error
* to prevent revealing secrets up the exceptional path. In the example
* above, the thrown error may reveal only that `sky.color` is a string,
* whereas the same diagnostic printed to the console reveals that the
* sky was green.
* sky was green. This masking can be disabled for an individual substitution value
* using `quote`.
*
* The `raw` member of a `template` is ignored, so a simple
* `string[]` can also be used as a template.
* The `raw` property of an input template array is ignored, so a simple
* array of strings may be provided directly.
*/

@@ -285,44 +288,24 @@

* @typedef {(template: TemplateStringsArray | string[], ...args: any) => never} FailTag
* The `Fail` tamplate tag supports replacing patterns like
*
* Use the `Fail` function as a template literal tag to efficiently
* create and throw a `details`-style error only when a condition is not satisfied.
* ```js
* assert(cond, X`...complaint...`);
* condition || Fail`...complaint...`;
* ```
* or
* This avoids the overhead of creating usually-unnecessary errors like
* ```js
* cond || assert.fail(X`...complaint...`);
* assert(condition, details`...complaint...`);
* ```
* with patterns like
* while improving readability over alternatives like
* ```js
* cond || Fail`...complaint...`;
* condition || assert.fail(details`...complaint...`);
* ```
*
* However, due to [weakness in current
* TypeScript](https://github.com/microsoft/TypeScript/issues/51426), the `||`
* patterns are not as powerful as the `assert(...)` call at enabling static
* reasoning. Of the `||`, again due to weaknesses in current TypeScript,
* the
* ```js
* cond || Fail`...complaint...`
* ```
* pattern is not as powerful as the
* ```js
* cond || assert.fail(X`...complaint...`);
* ```
* at enabling static resoning. Despite these problems, we do not want to
* return to the
* ```js
* assert(cond, X`...complaint...`)
* ```
* style because of the substantial overhead in
* evaluating the `X` template in the typical `true` case where it is not
* needed. And we do not want to return to the
* ```js
* assert.fail(X`...complaint...`)`
* ```
* because of the verbosity and loss of readability. Instead, until/unless
* https://github.com/microsoft/TypeScript/issues/51426 is fixed, for those
* new-style assertions where this loss of static reasoning is a problem,
* However, due to current weakness in TypeScript, static reasoning
* is less powerful with the `||` patterns than with an `assert` call.
* Until/unless https://github.com/microsoft/TypeScript/issues/51426 is fixed,
* for `||`-style assertions where this loss of static reasoning is a problem,
* instead express the assertion as
* ```js
* if (!cond) {
* if (!condition) {
* Fail`...complaint...`;

@@ -333,9 +316,7 @@ * }

* ```js
* if (!cond) {
* // `throw` is noop since `Fail` throws. But linter confused
* if (!condition) {
* // `throw` is noop since `Fail` throws, but it improves static analysis
* throw Fail`...complaint...`;
* }
* ```
* This avoid the TypeScript bugs that cause the loss of static reasoning,
* but with no loss of efficiency and little loss of readability.
*/

@@ -378,3 +359,3 @@

/**
* @typedef {Object} VirtualConsole
* @typedef {object} VirtualConsole
* @property {Console['debug']} debug

@@ -381,0 +362,0 @@ * @property {Console['log']} log

@@ -23,3 +23,3 @@ import {

*
* @param {Object} obj
* @param {object} obj
*/

@@ -42,3 +42,3 @@ function getConstructorOf(obj) {

*
* @returns {Object}
* @returns {object}
*/

@@ -45,0 +45,0 @@ export const getAnonymousIntrinsics = () => {

@@ -16,2 +16,5 @@ import { FERAL_REG_EXP, regexpExec, stringSlice } from './commons.js';

/**
* @param {string} src
*/
export const getSourceURL = src => {

@@ -18,0 +21,0 @@ let sourceURL = '<unknown>';

@@ -25,3 +25,3 @@ import {

*
* @param {Object} globalObject
* @param {object} globalObject
*/

@@ -52,3 +52,3 @@ export const setGlobalObjectSymbolUnscopables = globalObject => {

*
* @param {Object} globalObject
* @param {object} globalObject
*/

@@ -73,8 +73,8 @@ export const setGlobalObjectConstantProperties = globalObject => {

*
* @param {Object} globalObject
* @param {Object} param1
* @param {Object} param1.intrinsics
* @param {Object} param1.newGlobalPropertyNames
* @param {object} globalObject
* @param {object} param1
* @param {object} param1.intrinsics
* @param {object} param1.newGlobalPropertyNames
* @param {Function} param1.makeCompartmentConstructor
* @param {(Object) => void} param1.markVirtualizedNativeFunction
* @param {(object) => void} param1.markVirtualizedNativeFunction
*/

@@ -141,5 +141,5 @@ export const setGlobalObjectMutableProperties = (

*
* @param {Object} globalObject
* @param {object} globalObject
* @param {Function} evaluator
* @param {(Object) => void} markVirtualizedNativeFunction
* @param {(object) => void} markVirtualizedNativeFunction
*/

@@ -146,0 +146,0 @@ export const setGlobalObjectEvaluators = (

@@ -163,3 +163,3 @@ import {

*
* @param {Object} globalObject
* @param {object} globalObject
*/

@@ -166,0 +166,0 @@ export const getGlobalIntrinsics = globalObject => {

@@ -56,3 +56,3 @@ // Copyright (C) 2018 Agoric

/** @typedef {import('../index.js').LockdownOptions} LockdownOptions */
/** @typedef {import('../types.js').LockdownOptions} LockdownOptions */

@@ -81,5 +81,5 @@ const { Fail, details: d, quote: q } = assert;

* @callback CompartmentConstructor
* @param {Object} endowments
* @param {Object} moduleMap
* @param {Object} [options]
* @param {object} endowments
* @param {object} moduleMap
* @param {object} [options]
* @param {Array<Transform>} [options.transforms]

@@ -120,2 +120,3 @@ * @param {Array<Transform>} [options.__shimTransforms__]

if (!allowed) {
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DIRECT_EVAL.md
throw new TypeError(

@@ -212,2 +213,3 @@ `SES cannot initialize unless 'eval' is the original intrinsic 'eval', suitable for direct-eval (dynamically scoped eval) (SES_DIRECT_EVAL)`,

);
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_ALREADY_LOCKED_DOWN.md
priorLockdown = new TypeError('Prior lockdown (SES_ALREADY_LOCKED_DOWN)');

@@ -254,2 +256,3 @@ // Tease V8 to generate the stack string and release the closures the stack

if (seemsToBeLockedDown()) {
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_MULTIPLE_INSTANCES.md
throw new TypeError(

@@ -256,0 +259,0 @@ `Already locked down but not by this SES instance (SES_MULTIPLE_INSTANCES)`,

@@ -55,3 +55,3 @@ // Adapted from SES/Caja - Copyright (C) 2011 Google Inc.

/**
* @typedef {import('../index.js').Harden} Harden
* @typedef {import('../types.js').Harden} Harden
*/

@@ -58,0 +58,0 @@

@@ -19,5 +19,5 @@ // Portions adapted from V8 - Copyright 2016 the V8 project authors.

*
* @param {Object} options
* @param {Object} options.globalObject
* @param {Object} [options.moduleLexicals]
* @param {object} options
* @param {object} options.globalObject
* @param {object} [options.moduleLexicals]
* @param {Array<Transform>} [options.globalTransforms]

@@ -57,3 +57,3 @@ * @param {bool} [options.sloppyGlobalsMode]

* @param {string} source
* @param {Object} [options]
* @param {object} [options]
* @param {Array<Transform>} [options.localTransforms]

@@ -60,0 +60,0 @@ */

@@ -139,2 +139,3 @@ import { assert } from './error/assert.js';

__needsImportMeta__: needsImportMeta = false,
__syncModuleFunctor__,
} = staticModuleRecord;

@@ -448,7 +449,12 @@

let optFunctor = compartmentEvaluate(compartmentFields, functorSource, {
globalObject: compartment.globalThis,
transforms: __shimTransforms__,
__moduleShimLexicals__: moduleLexicals,
});
let optFunctor;
if (__syncModuleFunctor__ !== undefined) {
optFunctor = __syncModuleFunctor__;
} else {
optFunctor = compartmentEvaluate(compartmentFields, functorSource, {
globalObject: compartment.globalThis,
transforms: __shimTransforms__,
__moduleShimLexicals__: moduleLexicals,
});
}
let didThrow = false;

@@ -455,0 +461,0 @@ let thrownError;

@@ -322,3 +322,3 @@ // For brevity, in this file, as in module-link.js, the term "moduleRecord"

const pendingJobs = new Set();
/** @type {Map<Object, Map<string, Promise<Record>>} */
/** @type {Map<object, Map<string, Promise<Record>>} */
const moduleLoads = new Map();

@@ -325,0 +325,0 @@ /** @type {Array<Error>} */

@@ -146,4 +146,4 @@ import {

*
* @param {Object} globalObject
* @param {Object} moduleLexicals
* @param {object} globalObject
* @param {object} moduleLexicals
*/

@@ -150,0 +150,0 @@ export const getScopeConstants = (globalObject, moduleLexicals = {}) => {

@@ -54,1 +54,2 @@ import {

};
freeze(createSloppyGlobalsScopeTerminator);

@@ -29,2 +29,3 @@ // @ts-check

// becomes a get, set pair after domains initialize.
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_DOMAINS.md
throw new TypeError(

@@ -31,0 +32,0 @@ `SES failed to lockdown, Node.js domains have been initialized (SES_NO_DOMAINS)`,

@@ -20,3 +20,3 @@ import {

// See https://tc39.es/ecma262/#sec-string.prototype.localecompare
localeCompare(that) {
localeCompare(arg) {
if (this === null || this === undefined) {

@@ -28,3 +28,3 @@ throw new TypeError(

const s = `${this}`;
that = `${that}`;
const that = `${arg}`;
if (s < that) {

@@ -31,0 +31,0 @@ return -1;

@@ -10,2 +10,3 @@ // @ts-check

stringSplit,
freeze,
} from './commons.js';

@@ -73,2 +74,3 @@ import { getSourceURL } from './get-source-url.js';

const name = getSourceURL(src);
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_HTML_COMMENT_REJECTED.md
throw new SyntaxError(

@@ -149,2 +151,3 @@ `Possible HTML comment rejected at ${name}:${lineNumber}. (SES_HTML_COMMENT_REJECTED)`,

const name = getSourceURL(src);
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_IMPORT_REJECTED.md
throw new SyntaxError(

@@ -221,2 +224,3 @@ `Possible import expression rejected at ${name}:${lineNumber}. (SES_IMPORT_REJECTED)`,

const name = getSourceURL(src);
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_EVAL_REJECTED.md
throw new SyntaxError(

@@ -256,1 +260,12 @@ `Possible direct eval expression rejected at ${name}:${lineNumber}. (SES_EVAL_REJECTED)`,

};
// export all as a frozen object
export const transforms = freeze({
rejectHtmlComments: freeze(rejectHtmlComments),
evadeHtmlCommentTest: freeze(evadeHtmlCommentTest),
rejectImportExpressions: freeze(rejectImportExpressions),
evadeImportExpressionTest: freeze(evadeImportExpressionTest),
rejectSomeDirectEvalExpressions: freeze(rejectSomeDirectEvalExpressions),
mandatoryTransforms: freeze(mandatoryTransforms),
applyTransforms: freeze(applyTransforms),
});

@@ -69,4 +69,4 @@ // Copyright (C) 2011 Google Inc.

*
* @param {Object} intrinsics
* @param {(Object) => void} markVirtualizedNativeFunction
* @param {object} intrinsics
* @param {(object) => void} markVirtualizedNativeFunction
*/

@@ -73,0 +73,0 @@ export default function whitelistIntrinsics(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc