Skip to content

Commit

Permalink
feat: add HandledPromise shim before lockdown()
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 14, 2020
1 parent 794dc12 commit 5574462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/dapp-svelte-wallet/ui/src/install-ses-lockdown.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'ses/lockdown';
import '@agoric/eventual-send/shim';

lockdown({ errorTaming: 'unsafe' });
9 changes: 5 additions & 4 deletions packages/install-ses/install-ses.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* global lockdown */

// 'lockdown' appears on the global as a side-effect of importing 'ses'
import 'ses';

// we need to enable Math.random as a workaround for 'brace-expansion' module
// (dep chain: cosmic-swingset/ag-solo->temp->glob->minimatch->brace-expansion)
// we need Date.now to build a timer device for cosmic-swingset
lockdown({ mathTaming: 'unsafe', dateTaming: 'unsafe', errorTaming: 'unsafe' });
// Install our HandledPromise global.
import '@agoric/eventual-send/shim';

lockdown({ errorTaming: 'unsafe' });
// We are now in the "Start Compartment". Our global has all the same
// powerful things it had before, but the primordials have changed to make
// them safe to use in the arguments of API calls we make into more limited
Expand Down

0 comments on commit 5574462

Please sign in to comment.