fix(ses): Send removal warnings to STDERR
MODIFY
packages/ses/NEWS.md
packages/ses/NEWS.md
User-visible changes in SES:
+# Next release
+
+- The `Removing...` messages that Lockdown emits when encountering unrecognized
+ properties on shared intrinsics are now logged as "warnings".
+ This has the material benefit of sending these messages to STDERR on Node.js.
+
# 0.15.1 (2021-11-15)
- The TypeScript definition of `lockdown` now allows for the option

MODIFY
packages/ses/src/make-hardener.js
packages/ses/src/make-hardener.js
@@ -85,7 +85,7 @@ export const makeHardener = () => {
// Ignore if this is an exit, or we've already visited it
return;
}
- // console.log(`adding ${val} to toFreeze`, val);
+ // console.warn(`adding ${val} to toFreeze`, val);
setAdd(toFreeze, val);
weakmapSet(paths, val, path);
}
@@ -150,7 +150,7 @@ export const makeHardener = () => {
enqueue(root);
dequeue();
- // console.log("toFreeze set:", toFreeze);
+ // console.warn("toFreeze set:", toFreeze);
commit();
return root;

MODIFY
packages/ses/src/whitelist-intrinsics.js
packages/ses/src/whitelist-intrinsics.js
@@ -244,11 +244,11 @@ export default function whitelistIntrinsics(
// that we are removing it so we know to look into it, as happens when
// the language evolves new features to existing intrinsics.
if (subPermit !== false) {
- // This call to `console.log` is intentional. It is not a vestige
- // of a debugging attempt. See the comment at top of file for an
+ // This call to `console.warn` is intentional. It is not a vestige of
+ // a debugging attempt. See the comment at top of file for an
// explanation.
// eslint-disable-next-line @endo/no-polymorphic-call
- console.log(`Removing ${subPath}`);
+ console.warn(`Removing ${subPath}`);
}
try {
delete obj[prop];

fix(ses): Send removal warnings to STDERR (#949)