trying to use your library with my vscode extension. Problem, the super weird Array hashmap stuff is breaking as the for(var name in this.attributs.items) { will not only return added items but also functionnames. no clue why this does not happen on the console but breaks in vscode (maybe more strict?) but the usage feels a bit strange anyway.
I quickly checked the open PR's and #23 appears to solve that problem with an hasOwnProperty check. I guess there are likely more people having the same issues. #23 is a hack but will probably fix the problem as a short-term solution. Any thoughts on merging it? Otherwise I'll have to switch to a different lib.
TypeError: Cannot read property 'type' of undefined
soljson.js:28
at mustBeQuoted (node_modules/surya/node_modules/graphviz/lib/deps/attributs.js:190:42)
at quoteMe (node_modules/surya/node_modules/graphviz/lib/deps/attributs.js:194:6)
at exports.Attributs.Attributs.to_dot (node_modules/surya/node_modules/graphviz/lib/deps/attributs.js:241:56)
at exports.Graph.Graph.to_dot (node_modules/surya/node_modules/graphviz/lib/deps/graph.js:249:61)
at Object.graph (node_modules/surya/lib/graph.js:462:63)
at Commands.surya (src/features/commands.js:53:29)
at src/extension.js:625:30
it is undefined because the in op returned GetEnumerator which is an array method and not an item. see screenshot. left side contents of the hash-array-thing, right side tooltip contents of name (GetEnumerator). this will later break in mustBeQuoted as GetEnumerator is no valid attrib (was never set by our code).
Hi @glejeune,
trying to use your library with my vscode extension. Problem, the super weird
Array
hashmap stuff is breaking as thefor(var name in this.attributs.items) {
will not only return added items but also functionnames. no clue why this does not happen on the console but breaks in vscode (maybe more strict?) but the usage feels a bit strange anyway.I quickly checked the open PR's and #23 appears to solve that problem with an
hasOwnProperty
check. I guess there are likely more people having the same issues. #23 is a hack but will probably fix the problem as a short-term solution. Any thoughts on merging it? Otherwise I'll have to switch to a different lib.it is undefined because the
in
op returnedGetEnumerator
which is an array method and not an item. see screenshot. left side contents of the hash-array-thing, right side tooltip contents ofname
(GetEnumerator
). this will later break inmustBeQuoted
asGetEnumerator
is no valid attrib (was never set by our code).cheers, tin