Closed Adamhtml closed 9 years ago
Wow, I'd forgotten that Function#name
was not standard yet every browser but IE supports it. I'll look into alternatives. In the meantime, is it possible for you to precompile your templates in another environment?
Sadly, I require a purely browser-based solution which supports IE. I can wait for an update if you think one might be ready soon, or downgrade to the older version in the interim. Cheers!
I might have a solution that I can try to attempt tonight:
var nodes = [ProgramNode, TextNode, MarkupNode, ...]
if (ProgramNode.name) return;
nodes.forEach(function(node) {
var name = /^function\s+?([a-z_0-9]+)\s+?\{/.exec(node.toString();
node.name = name;
})
With a minor change to the regex to permit uppercase and the argument list parenthesis, it might just work!
/^function\s+([A-Za-z0-9_]+)\s*\(/
@Adamhtml I published a new version v0.8.5... do you mind trying it on IE? I don't have a great IE dev environment setup at the moment.
Confirmed, v0.8.5 does appear to correct the issue in IE. Thanks!
Awesome, thanks for the great bug report!
I realize most folks are probably using vash with nodejs, however the last known version of vash to work in IE 10 was 0.7.12. Version 0.8.0 fails on line 1293, character 3. Subsequent versions similarly fail in Internet Explorer.
Reason: this.node.constructor.name returns 'undefined' in IE