Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@endo/static-module-record

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@endo/static-module-record - npm Package Compare versions

Comparing version 0.6.6 to 0.6.7

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

### [0.6.7](https://github.com/endojs/endo/compare/@endo/static-module-record@0.6.6...@endo/static-module-record@0.6.7) (2021-12-08)
### Bug Fixes
* Avoid eslint globs for Windows ([4b4f3cc](https://github.com/endojs/endo/commit/4b4f3ccaf3f5e8d53faefb4264db343dd603bf80))
* **static-module-record:** cleaner Babel codegen ([6e22569](https://github.com/endojs/endo/commit/6e22569b0c3f56e9f78d59943235b97ba0429921))
* **static-module-record:** minimise source changes with `recast` ([ce464ff](https://github.com/endojs/endo/commit/ce464ffddc9fbee27ab167b5cb06e0c788ae31e7))
### [0.6.6](https://github.com/endojs/endo/compare/@endo/static-module-record@0.6.5...@endo/static-module-record@0.6.6) (2021-11-16)

@@ -8,0 +19,0 @@

19

package.json
{
"name": "@endo/static-module-record",
"version": "0.6.6",
"version": "0.6.7",
"description": "Shim for the SES StaticModuleRecord and module-to-program transformer",

@@ -33,13 +33,16 @@ "keywords": [

"lint:types": "tsc --build jsconfig.json",
"lint:js": "eslint '**/*.js'",
"lint-fix": "eslint --fix '**/*.js'",
"lint:js": "eslint .",
"lint-fix": "eslint --fix .",
"test": "ava"
},
"dependencies": {
"@agoric/babel-standalone": "^7.14.3"
"@agoric/babel-standalone": "^7.14.3",
"@agoric/recast": "^0.20.6",
"@babel/traverse": "^7.10.4",
"@babel/types": "^7.10.4"
},
"devDependencies": {
"@ava/babel": "^1.0.1",
"@endo/eslint-config": "^0.3.18",
"@endo/ses-ava": "^0.2.11",
"@endo/eslint-config": "^0.3.19",
"@endo/ses-ava": "^0.2.12",
"ava": "^3.12.1",

@@ -55,3 +58,3 @@ "babel-eslint": "^10.0.3",

"prettier": "^1.19.1",
"ses": "^0.15.1",
"ses": "^0.15.2",
"typescript": "^4.0.5"

@@ -83,3 +86,3 @@ },

},
"gitHead": "f445a041c413195f29c2e929e28f87c62a80d943"
"gitHead": "26d991afb01cf824827db0c958c50970e038112f"
}

@@ -78,2 +78,16 @@ /* eslint max-lines: 0 */

const rewriteModules = pass => ({ types: t }) => {
const replace = (
src,
node = t.expressionStatement(t.identifier('null')),
) => {
node.loc = src.loc;
node.comments = [...(src.leadingComments || [])];
t.inheritsComments(node, src);
return node;
};
const prependReplacements = (replacements, node) => {
replacements.unshift(node);
};
const allowedHiddens = new WeakSet();

@@ -243,3 +257,3 @@ const rewrittenDecls = new WeakSet();

const isConst = decl.kind === 'const';
const replace = rewriteVars(
const replacements = rewriteVars(
vids,

@@ -252,3 +266,3 @@ isConst,

if (replace.length > 0) {
if (replacements.length > 0) {
switch (decl.type) {

@@ -258,7 +272,7 @@ case 'VariableDeclaration': {

rewrittenDecls.add(decl);
replace.unshift(decl);
prependReplacements(replacements, decl);
break;
}
case 'FunctionDeclaration': {
replace.unshift(decl);
prependReplacements(replacements, decl);
break;

@@ -270,6 +284,4 @@ }

}
path.replaceWithMultiple(replacements);
}
if (replace.length > 0) {
path.replaceWithMultiple(replace);
}
};

@@ -398,3 +410,3 @@

path.replaceWithMultiple([
decl,
replace(path.node, decl),
t.expressionStatement(t.callExpression(callee, [decl.id])),

@@ -407,8 +419,11 @@ ]);

path.replaceWithMultiple([
t.variableDeclaration('const', [
t.variableDeclarator(
t.objectPattern([t.objectProperty(id, cid)]),
t.objectExpression([t.objectProperty(id, expr)]),
),
]),
replace(
path.node,
t.variableDeclaration('const', [
t.variableDeclarator(
t.objectPattern([t.objectProperty(id, cid)]),
t.objectExpression([t.objectProperty(id, expr)]),
),
]),
),
t.expressionStatement(t.callExpression(callee, [cid])),

@@ -577,3 +592,3 @@ ]);

if (doTransform) {
path.replaceWithMultiple(decl ? [decl] : []);
path.replaceWithMultiple(decl ? [replace(path.node, decl)] : []);
}

@@ -580,0 +595,0 @@ },

@@ -0,1 +1,5 @@

import * as recastCJS from '@agoric/recast';
import traverseCJS from '@babel/traverse';
import typesCJS from '@babel/types';
import * as h from './hidden.js';

@@ -42,2 +46,3 @@ import makeModulePlugins from './babelPlugin.js';

'classPrivateMethods',
'classPrivateProperties',
// 'v8intrinsic', // we really don't want people to rely on platform powers

@@ -52,25 +57,26 @@ 'partialApplication',

const allowAwaitOutsideFunction = false;
babel.transform(code, {
parserOpts: {
allowAwaitOutsideFunction,
plugins: parserPlugins,
const recast = recastCJS.default || recastCJS;
const ast = recast.parse(code, {
parser: {
parse: source =>
babel.transform(source, {
parserOpts: {
allowAwaitOutsideFunction,
tokens: true,
plugins: parserPlugins,
},
plugins: [analyzePlugin],
ast: true,
code: false,
}).ast,
},
generatorOpts: {
retainLines: true,
compact: false,
},
plugins: [analyzePlugin],
ast: false,
code: false,
});
({ code } = babel.transform(code, {
parserOpts: {
allowAwaitOutsideFunction,
plugins: parserPlugins,
},
generatorOpts: {
retainLines: true,
compact: false,
},
plugins: [transformPlugin],
const traverse = traverseCJS.default || traverseCJS;
const types = typesCJS.default || typesCJS;
traverse(ast, transformPlugin({ types }).visitor);
({ code } = recast.print(ast, {
wrapColumn: Infinity,
reuseWhitespace: true,
includeComments: true,
retainLines: true,
}));

@@ -77,0 +83,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc