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

shift-codegen

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shift-codegen - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

package.json
{
"name": "shift-codegen",
"version": "1.0.1",
"version": "1.0.2",
"description": "code generator for Shift format ASTs",

@@ -24,3 +24,3 @@ "author": "Shape Security Labs",

"object-assign": "^2.0.0",
"shift-reducer": "^1.0.2"
"shift-reducer": "^1.0.3"
},

@@ -33,4 +33,4 @@ "devDependencies": {

"mocha": "^2.0.1",
"shift-ast": "^1.0.1",
"shift-parser": "^1.0.0"
"shift-ast": "^1.0.3",
"shift-parser": "^1.0.2"
},

@@ -37,0 +37,0 @@ "keywords": [

@@ -28,2 +28,26 @@ Shift Code Generator

## Note on IfStatements
When presented with a valid structure that represents an IfStatement nested inside the consequent of an IfStatement that also has an alternate, we choose to generate code that preserves the intent of the AST rather than generate
valid code that executes in an unintended manner.
e.g., when generating code for an AST that *looks* like it represents this:
```js
if (a)
if (b) foo()
else bar()
```
We generate the following instead:
```js
if (a) {
if (b) foo()
} else bar()
```
The following parse of this code includes a BlockStatement and a Block wrapping the consequent of the outer IfStatement. This is considered optimal because the original AST is impossible to have been generated by a parse of actual JavaScript and could only occur from programmatic generation and that this resulting structure would have been the original intent.
## Contributing

@@ -30,0 +54,0 @@

Sorry, the diff of this file is too big to display

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