Skip to content

Commit

Permalink
et tu ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Oct 18, 2024
1 parent 2a449a1 commit aca33ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
12 changes: 7 additions & 5 deletions packages/ses/src-xs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const adapterFunctions = {
evaluate(source, options) {
const fields = weakmapGet(privateFields, this);
if (fields === undefined) {
throw new TypeError('this is not a compartment');
throw new TypeError('compartment.evaluate: this is not a compartment');
}
const { transforms, delegateNative, nativeEval } = fields;
for (const transform of transforms) {
Expand All @@ -83,7 +83,7 @@ const adapterFunctions = {
await null;
const fields = weakmapGet(privateFields, this);
if (fields === undefined) {
throw new TypeError('this is not a compartment');
throw new TypeError('compartment.import: this is not a compartment');
}
const { noNamespaceBox, delegateNative } = fields;
const delegateImport = delegateNative ? nativeImport : shimImport;
Expand All @@ -94,7 +94,7 @@ const adapterFunctions = {
importNow(specifier) {
const fields = weakmapGet(privateFields, this);
if (fields === undefined) {
throw new TypeError('this is not a compartment');
throw new TypeError('compartment.importNow: this is not a compartment');
}
const { delegateNative } = fields;
const delegateImportNow = delegateNative ? nativeImportNow : shimImportNow;
Expand Down Expand Up @@ -127,7 +127,9 @@ defineProperty(NativeCompartment.prototype, 'globalThis', {
get() {
const fields = weakmapGet(privateFields, this);
if (fields === undefined) {
throw new TypeError('this is not a compartment');
throw new TypeError(
'get compartment.globalThis: this is not a compartment',
);
}
const { delegateNative } = fields;
const delegateGetGlobalThis = delegateNative
Expand All @@ -143,7 +145,7 @@ defineProperty(NativeCompartment.prototype, 'name', {
get() {
const fields = weakmapGet(privateFields, this);
if (fields === undefined) {
throw new TypeError('this is not a compartment');
throw new TypeError('get compartment.name: this is not a compartment');
}
const { name } = fields;
return name;
Expand Down
15 changes: 8 additions & 7 deletions packages/ses/test/_xs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lockdown();
// spot checks
assert(Object.isFrozen(Object));

// import a precompiled module source in a shim compartment
print('# shim compartment can import a shim precompiled module source');

Check failure on line 25 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
const shimCompartment = new Compartment({
__options__: true,
Expand All @@ -39,7 +39,7 @@ assert(Object.isFrozen(Object));
);
}

// import a native module source in a native compartment
print('# native compartment can import a native ModuleSource');

Check failure on line 42 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
const nativeCompartment = new Compartment({
__options__: true,
Expand All @@ -59,6 +59,7 @@ assert(Object.isFrozen(Object));
);
}

print('# shim compartment cannot import a native ModuleSource');

Check failure on line 62 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
// fail to import a native module source in a shim compartment
{
let threw = null;
Expand All @@ -80,7 +81,7 @@ assert(Object.isFrozen(Object));
);
}

// fail to import a precompiled module source in a native compartment
print('# native compartment cannot import a shim precompiled module source');

Check failure on line 84 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
let threw = null;
try {
Expand All @@ -102,7 +103,7 @@ assert(Object.isFrozen(Object));
);
}

// can link shim compartments
print('# shim compartment can link to another shim compartment');

Check failure on line 106 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
const shimCompartment1 = new Compartment({
__options__: true,
Expand All @@ -128,7 +129,7 @@ assert(Object.isFrozen(Object));
);
}

// can link native compartments
print('# native compartment can link to another native compartment');

Check failure on line 132 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
const nativeCompartment1 = new Compartment({
__options__: true,
Expand Down Expand Up @@ -158,7 +159,7 @@ assert(Object.isFrozen(Object));
);
}

// cannot link native from shim compartment
print('# shim compartment cannot link a native compartment');

Check failure on line 162 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
const nativeCompartment = new Compartment({
__options__: true,
Expand Down Expand Up @@ -189,7 +190,7 @@ assert(Object.isFrozen(Object));
assert(threw, 'cannot link native from shim compartment');
}

// cannot link shim from native compartment
print('# native compartment cannot link shim compartment');

Check failure on line 193 in packages/ses/test/_xs.js

View workflow job for this annotation

GitHub Actions / lint

'print' is not defined
{
const shimCompartment = new Compartment({
__options__: true,
Expand Down

0 comments on commit aca33ea

Please sign in to comment.