ses
Version:
Hardened JavaScript for Fearless Cooperation
12 lines (9 loc) • 349 B
JavaScript
import { TypeError } from './commons.js';
/** getThis returns globalThis in sloppy mode or undefined in strict mode. */
function getThis() {
return this;
}
if (getThis()) {
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_SLOPPY.md
throw TypeError(`SES failed to initialize, sloppy mode (SES_NO_SLOPPY)`);
}