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

cst

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cst - npm Package Compare versions

Comparing version 0.4.9 to 0.4.10

30

lib/elements/types/ClassBody.js

@@ -33,2 +33,11 @@ 'use strict';

function isCode(_ref) {
var currentElement = _ref.currentElement;
var _ref2 = currentElement || {},
isCode = _ref2.isCode;
return isCode !== false;
}
var ClassBody = function (_Node) {

@@ -52,16 +61,15 @@ (0, _inherits3.default)(ClassBody, _Node);

while (!children.isToken('Punctuator', '}')) {
if (children.isNode('ClassProperty')) {
body.push(children.passNode('ClassProperty'));
}
if (children.isNode('ClassMethod')) {
body.push(children.passNode('ClassMethod'));
}
// For the class Test { x() {}; } case
if (children.isToken('Punctuator', ';')) {
// For the class Test { x() {}; } case
children.passToken('Punctuator', ';');
} else if (!isCode(children)) {
children.skipNonCode();
} else {
children.assertOneOfNode(['ClassProperty', 'ClassMethod']);
if (children.isNode('ClassProperty')) {
body.push(children.passNode('ClassProperty'));
} else if (children.isNode('ClassMethod')) {
body.push(children.passNode('ClassMethod'));
}
}
children.skipNonCode();
}

@@ -68,0 +76,0 @@

@@ -63,2 +63,3 @@ 'use strict';

children.skipSemicolon();
children.assertEnd();

@@ -65,0 +66,0 @@

@@ -44,2 +44,3 @@ 'use strict';

value: function _acceptChildren(children) {
children.skipNonCode();
children.assertEnd();

@@ -46,0 +47,0 @@ }

@@ -31,2 +31,6 @@ 'use strict';

var _Identifier = require('./Identifier');
var _Identifier2 = _interopRequireDefault(_Identifier);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -93,2 +97,6 @@

return children.passNode();
} else if (children.isToken('Identifier')) {
// This element is skipped in elementTree::buildElementTreeItem due to:
// https://github.com/babel/babylon/issues/49
return new _Identifier2.default([children.passToken()]);
} else {

@@ -95,0 +103,0 @@ children.passToken('Punctuator', '[');

{
"name": "cst",
"version": "0.4.9",
"version": "0.4.10",
"description": "JavaScript CST Implementation",

@@ -5,0 +5,0 @@ "author": "Marat Dulin",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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