Comparing version 0.3.4 to 0.3.5
{ | ||
"name": "rocambole", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Recursively walk and transform EcmaScript AST", | ||
@@ -5,0 +5,0 @@ "main": "rocambole.js", |
@@ -230,2 +230,11 @@ # Rocambole [![Build Status](https://secure.travis-ci.org/millermedeiros/rocambole.png?branch=master)](https://travis-ci.org/millermedeiros/rocambole) | ||
### v0.3.5 (2014/06/23) | ||
- handle sparse arrays (eg. `[,]`). (#15) | ||
### v0.3.4 (2014/06/23) | ||
- only add `BlockComment.originalIndent` if `WhiteSpace` is on the start of | ||
a line. | ||
### v0.3.3 (2014/04/26) | ||
@@ -232,0 +241,0 @@ |
@@ -78,2 +78,6 @@ /*jshint node:true */ | ||
var instrumentNodes = function(node, parent, prev, next){ | ||
// sparse arrays might have `null` elements, so we skip those for now | ||
// see issue #15 | ||
if (!node) return false; | ||
node.parent = parent; | ||
@@ -80,0 +84,0 @@ node.prev = prev; |
@@ -359,3 +359,16 @@ /*global describe:false, it:false, beforeEach:false */ | ||
describe('sparse array', function() { | ||
// yes, people shold not be writting code like this, but we should not | ||
// bail when that happens | ||
it('should not fail on sparse arrays', function() { | ||
var ast = rocambole.parse('[,3,[,4]]'); | ||
expect(ast.toString()).to.eql('[,3,[,4]]'); | ||
var elements = ast.body[0].expression.elements; | ||
expect(elements[0]).to.be(null); | ||
expect(elements[1].type).to.be('Literal'); | ||
expect(elements[1].value).to.be(3); | ||
}); | ||
}); | ||
}); | ||
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
415532
9337
290