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

flast

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flast - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

2

package.json
{
"name": "flast",
"version": "1.2.4",
"version": "1.2.5",
"description": "Flatten JS AST",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -57,3 +57,8 @@ // noinspection JSUnusedGlobalSymbols

const parseOpts = opts.parseOpts || {};
const rootNode = parseCode(inputCode, parseOpts);
let rootNode;
try {
rootNode = parseCode(inputCode, parseOpts);
} catch (e) {
if (e.message.includes('in strict mode')) rootNode = parseCode(inputCode, {...parseOpts, sourceType: 'script'});
}
let scopeManager;

@@ -60,0 +65,0 @@ try {

@@ -89,2 +89,19 @@ const assert = require('node:assert');

},
{
enabled: true,
name: 'Dynamic sourceType switching',
description: `Verify a script is parsed in "sloppy mode" if strict mode is restricting parsing.`,
run() {
const code = `let a; delete a;`;
let ast = [];
let error = '';
try {
ast = generateFlatAST(code);
} catch (e) {
error = e.message;
}
assert(ast.length,
`Script was not parsed. Got the error "${error}"`);
},
},
];

Sorry, the diff of this file is not supported yet

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