assetgraph
Advanced tools
Comparing version 0.3.19 to 0.3.21
@@ -88,13 +88,11 @@ var util = require('util'), | ||
this.parseTree[1]._parent = this.parseTree; | ||
var queue = [this.parseTree[1]], | ||
queueIndex = 0; | ||
var stack = [this.parseTree[1]]; | ||
while (queueIndex < queue.length) { | ||
var node = queue[queueIndex]; | ||
queueIndex += 1; | ||
while (stack.length) { | ||
var node = stack.pop(); | ||
for (var i = 0 ; i < node.length ; i++) { | ||
for (var i = node.length - 1 ; i >= 0 ; i--) { | ||
if (Array.isArray(node[i])) { | ||
node[i]._parent = node; | ||
queue.push(node[i]); | ||
stack.push(node[i]); | ||
} | ||
@@ -101,0 +99,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"repository": "git://github.com/One-com/assetgraph.git", | ||
"version": "0.3.19", | ||
"version": "0.3.21", | ||
"maintainers": [ | ||
@@ -8,0 +8,0 @@ { |
var vows = require('vows'), | ||
assert = require('assert'), | ||
_ = require('underscore'), | ||
AssetGraph = require('../lib/AssetGraph'), | ||
@@ -9,3 +10,3 @@ transforms = AssetGraph.transforms; | ||
topic: function () { | ||
var assetGraph = new AssetGraph({root: __dirname + '/JavaScript/'}).queue( | ||
new AssetGraph({root: __dirname + '/JavaScript/'}).queue( | ||
transforms.loadAssets('parseErrorInInlineJavaScript.html') | ||
@@ -38,3 +39,19 @@ ).run(this.callback); | ||
} | ||
}, | ||
'after loading test case with relations located at multiple levels in the parse tree': { | ||
topic: function () { | ||
new AssetGraph({root: __dirname + '/JavaScript/relationsDepthFirst/'}).queue( | ||
transforms.loadAssets('relationsDepthFirst.js'), | ||
transforms.populate() | ||
).run(this.callback); | ||
}, | ||
'the relations should be in depth-first order in the graph': function (assetGraph) { | ||
assert.deepEqual(_.pluck(assetGraph.findRelations(), 'href'), | ||
[ | ||
'foo.js', | ||
'data.json', | ||
'bar.js' | ||
]); | ||
} | ||
} | ||
})['export'](module); |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
661240
366
10927
28