Skip to content
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

Encode opening brackets in contextDump helper #94

Merged
merged 1 commit into from
Oct 10, 2014

Conversation

prashn64
Copy link
Contributor

@prashn64 prashn64 commented Oct 6, 2014

No description provided.

@@ -178,6 +178,8 @@ var helpers = {
else {
dump = JSON.stringify(context.stack.head, jsonFilter, 2);
}
// encode opening brackets
dump = dump.replace(/</g, '\\u003c');
if (to === 'console') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be part of jsonFilter function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we prolly only need this in the else case. console.log AFAIK is pretty safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kate2753 the jsonFilter function acts on each key value pair, so I figure this is a bit more performant.

@jimmyhchan why's that, couldn't the current context still have opening brackets?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.logging with open brackets is not an issue. chunk.write with open brackets is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see, you mean the else with chunk.write. Yeah that makes sense.

@prashn64
Copy link
Contributor Author

bump

jimmyhchan added a commit that referenced this pull request Oct 10, 2014
Encode opening brackets in contextDump helper
@jimmyhchan jimmyhchan merged commit 613e2b7 into LinkedInAttic:master Oct 10, 2014
@jimmyhchan
Copy link
Contributor

...slow your roll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants