-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Usage of RegExp Objects #71
base: master
Are you sure you want to change the base?
Conversation
-commented require.paths from syntax_highlighter, deprecated in node.js 0.6.8
…ated in node.0.6.8
binary = binary.replace(/([\u0000-\u001F\u0080-\u009F])/g, function (x, char) { | ||
if (/[^\r\n\t]/(char)) { | ||
var num = char.charCodeAt(0).toString(16); | ||
binary = binary.replace(/([\u0000-\u001F\u0080-\u009F])/g, function (x, chr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed variable name from char to chr, just to be on the sure side, since some sources say that Java keywords are reserved in JavaScript, although it seems to work in my local node.
Seems to fix issue #62 for me as well. |
Nice work Doc!
|
Great! You can also fix the path issues by replacing require's with relative paths. I liked the old trickery with the require.paths array but it seems its no longer supported by node. |
RegExp Objects, that is Regular Expressions created with /.../ were used wrongly throughout the code, as first remarked by boog.
They cannot be matched on a string just like: /.../(string), but need to be called upon with either test or exec, cf. here: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp.
I also commented out require.paths which is deprecated in node 0.6.8 and thus does not work.
You need to add the requisite paths to your env under NODE_PATH, like boog had also remarked in #68.
With these out of the way, and recompiling TermKit for 10.7 it actually worked for me.