From 8c2cc63acb78f8a169c53804d64304e8e954f7df Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Tue, 9 Feb 2021 12:35:57 -0600 Subject: [PATCH] fix(xsnap): freeze API surface --- packages/xsnap/src/xsnap.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/xsnap/src/xsnap.js b/packages/xsnap/src/xsnap.js index 646cb2d1912..e5ad4e1942d 100644 --- a/packages/xsnap/src/xsnap.js +++ b/packages/xsnap/src/xsnap.js @@ -32,6 +32,8 @@ const importMetaUrl = `file://${__filename}`; const encoder = new TextEncoder(); const decoder = new TextDecoder(); +const { freeze } = Object; + /** * @param {Uint8Array} arg * @returns {Uint8Array} @@ -276,7 +278,7 @@ export function xsnap(options) { return vatExit.promise.catch(() => {}); } - return { + return freeze({ issueCommand, issueStringCommand, close, @@ -285,5 +287,5 @@ export function xsnap(options) { execute, import: importModule, snapshot: writeSnapshot, - }; + }); }