-
SES, the Hardened JavaScript shim https://github.com/endojs/endo/tree/master/packages/ses
-
TC39 Compartments Proposal https://github.com/tc39/proposal-compartments
-
Slides for “Dear Google, Let’s Harden JavaScript” https://kriskowal.com/dear-google-hardened-javascript.pdf
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { makeStream, nullQueue } from '@endo/stream'; | |
/** | |
* @template TValue | |
*/ | |
const makePubSub = () => { | |
// Request pubsub async queue internals | |
let { promise: tailPromise, resolve: tailResolve } = makePromiseKit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { makeStream, nullQueue } from '@endo/stream'; | |
/** | |
* @template TValue | |
*/ | |
const makePubSub = () => { | |
// Request pubsub async queue internals | |
let { promise: tailPromise, resolve: tailResolve } = makePromiseKit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeNearReader = reader => | |
Far('Reader', { | |
async next() { | |
const iteration = await reader.next(); | |
if (iteration.done) { | |
return iteration; | |
} | |
return harden({ value: encodeBase64(iteration.value) }); | |
}, | |
async return(value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"colors": { | |
"darkBlue": "#61B2E4", | |
"darkRed": "#D22F27", | |
"darkGreen": "#5C9E31", | |
"lightPurple": "#B399C8" | |
}, | |
"levels": [ | |
{ | |
"topology": "torus", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @template T | |
* @typedef {object} Schema | |
* @prop {() => T} number | |
* @prop {() => T} boolean | |
* @prop {() => T} string | |
* @prop {(t: T) => T} optional | |
* @prop {(t: T) => T} list | |
* @prop {(t: T) => T} dict | |
* @prop {(shape: Record<string, T>) => T} struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"colors": { | |
"lightBlue": "#92D3F5", | |
"darkBlue": "#61B2E4", | |
"lightRed": "#EA5A47", | |
"darkRed": "#D22F27", | |
"lightGreen": "#B14CC3", | |
"darkGreen": "#5C9E31", | |
"lightYellow": "#FCEA2B", | |
"darkYellow": "#F1B31C", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// So, in sloppy mode, eval and var can do interesting things. | |
globalThis.name = 'global'; | |
console.log(name === 'global'); | |
(function () { | |
const name = 'outer'; | |
// direct eval, using a var declaration. | |
(function () { |
NewerOlder