-
Notifications
You must be signed in to change notification settings - Fork 2k
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
column
property from error messages is non-enumerable in 4.0.6 with noEscape: true
(breaking regression)
#1284
Comments
I know that... Read the subject like one more time. I'm talking about error message shape. The column of the error is missing. |
The part I don't fully understand right now is the following. I have done tests with 4.0.5 and 4.0.6 and the following program: try {
require('handlebars').compile('abc{{#abd}}aasds{{/ab}}')({abc: 'test'});
} catch (e) {
console.log('1) ', JSON.parse(JSON.stringify(e)))
console.log('2) ', {lineNumber: e.lineNumber, column: e.column});
} The Output with Handlebars@4.0.5
Output with Handlebars@4.0.6
|
Ah yes, I tried it and see your results @nknapp, but I am using the try {
require('handlebars').compile('abc{{#abd}}aasds{{/ab}}', { noEscape: true })({abc: 'test'});
} catch (e) {
console.log('1) ', JSON.parse(JSON.stringify(e)))
console.log('2) ', {lineNumber: e.lineNumber, column: e.column});
} Output with Handlebars@4.0.5
Output with Handlebars@4.0.6
Somehow that property is not enumerable: 4.0.5
4.0.6
|
column
property from error messages is non-enumerable in 4.0.6 (breaking regression)
column
property from error messages is non-enumerable in 4.0.6 (breaking regression)column
property from error messages is non-enumerable in 4.0.6 with noEscape: true
(breaking regression)
Oh yes it does. Thanks for the timely response! |
@kpdecker Can we somehow ensure that #1285 does not reintroduce the bug you fixed with 20c965c?
If this is safe, I would like to see #1285 being merged (squashed?).
It should then probably go into the master branch as well. Cherry-pick or merge?
Am 22. Dezember 2016 00:09:23 MEZ, schrieb Nathan Black <notifications@github.com>:
…> if this really solves your problem
Oh yes it does. `Object.defineProperty` defaults enumerable to false,
so it doesn't get JSON serialized out. (I tested it as well).
Thanks for the timely response!
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1284 (comment)
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
|
Related to handlebars-lang#1284 The test ensures that the property is there, because it is important to some people.
Fixes handlebars-lang#1284 Appearently, there is a use-case of stringifying the error in order to evaluated its properties on another system. There was a regression from 4.0.5 to 4.0.6 that the column-property of compilation errors was not enumerable anymore in 4.0.6 (due to commit 20c965c) and thus was not included in the output of "JSON.stringify".
@nknapp odds are I never reporduced that myself, just applied the bug fix referenced in the commit message and hoped that reduced the occurrences. Bugs like that, all you can really do is release it and hope it doesn't fuck up. (You'll find that with Handlebars, someone will be pissed for some reason for every change, so embrace it) |
Uh the big stems from not knowing how |
@nathanboktae the concern was that the change would cause a browser crasher, which any amount of knowledge of javascript isn't going to help as they don't really spec out "the browser will crash at this point" It's comments like these highlight why I'm no longer maintaining this project. After years of dealing with open source users at this large of a scale, for free mind you, I no longer am inclined to do the dirty work. If you don't like my attitude at this point, I suggest you invest your time in another project or spend timing maintaining the issues here. |
Related to handlebars-lang#1284 The test ensures that the property is there, because it is important to some people.
Fixes handlebars-lang#1284 Appearently, there is a use-case of stringifying the error in order to evaluated its properties on another system. There was a regression from 4.0.5 to 4.0.6 that the column-property of compilation errors was not enumerable anymore in 4.0.6 (due to commit 20c965c) and thus was not included in the output of "JSON.stringify".
Related to handlebars-lang#1284 The test ensures that the property is there, because it is important to some people.
Fixes handlebars-lang#1284 Appearently, there is a use-case of stringifying the error in order to evaluated its properties on another system. There was a regression from 4.0.5 to 4.0.6 that the column-property of compilation errors was not enumerable anymore in 4.0.6 (due to commit 20c965c) and thus was not included in the output of "JSON.stringify".
Related to #1284 The test ensures that the property is there, because it is important to some people.
Fixes #1284 Appearently, there is a use-case of stringifying the error in order to evaluated its properties on another system. There was a regression from 4.0.5 to 4.0.6 that the column-property of compilation errors was not enumerable anymore in 4.0.6 (due to commit 20c965c) and thus was not included in the output of "JSON.stringify".
The fix is merged into the 4.x-branch and should be published with 4.0.7. |
closing since this is merged in. Thanks! |
We had a test that tried to compile this simple template and verify the error result:
but it started failing on
4.0.6
. Rolling back to4.0.5
solves it.The text was updated successfully, but these errors were encountered: