Comparing version 0.4.9 to 0.4.10
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
739311
8413
0