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

recast

Package Overview
Dependencies
Maintainers
1
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recast - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

33

lib/printer.js

@@ -775,5 +775,8 @@ var assert = require("assert");

case "NumericLiteral": // Babel 6 Literal Split
// keep original representation for values not in base 10
if (n.extra && typeof n.extra.raw === "string")
// Keep original representation for numeric values not in base 10.
if (n.extra &&
typeof n.extra.raw === "string" &&
Number(n.extra.raw) === n.value) {
return fromString(n.extra.raw, options);
}

@@ -786,6 +789,11 @@ return fromString(n.value, options);

case "Literal":
// numeric values may be in bases other than 10
// Use their raw representation for esprima
// Numeric values may be in bases other than 10. Use their raw
// representation if equivalent.
if (typeof n.value === "number" &&
typeof n.raw === "string" &&
Number(n.raw) === n.value) {
return fromString(n.raw, options);
}
if (typeof n.value !== "string") {
if (typeof n.raw === "string") return fromString(n.raw, options);
return fromString(n.value, options);

@@ -1035,10 +1043,19 @@ }

case "CatchClause":
parts.push("catch (", path.call(print, "param"));
parts.push("catch ");
if (n.guard)
if (n.param) {
parts.push("(", path.call(print, "param"));
}
if (n.guard) {
// Note: esprima does not recognize conditional catch clauses.
parts.push(" if ", path.call(print, "guard"));
}
parts.push(") ", path.call(print, "body"));
if (n.param) {
parts.push(") ");
}
parts.push(path.call(print, "body"));
return concat(parts);

@@ -1045,0 +1062,0 @@

@@ -15,3 +15,3 @@ {

],
"version": "0.13.1",
"version": "0.13.2",
"homepage": "http://github.com/benjamn/recast",

@@ -42,3 +42,3 @@ "repository": {

"esprima-fb": "^15001.1001.0-dev-harmony-fb",
"flow-parser": "^0.65.0",
"flow-parser": "^0.66.0",
"mocha": "~5.0.0",

@@ -45,0 +45,0 @@ "reify": "^0.14.1",

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