These are chat archives for exceptionless/Discuss

7th
Dec 2015
theit8514
@theit8514
Dec 07 2015 15:08
Is csnover/TraceKit the proper repo?
Blake Niemyjski
@niemyjski
Dec 07 2015 15:09
Yes
Blake Niemyjski
@niemyjski
Dec 07 2015 16:53
@theit8514 were you able to create and run the tests ok?
theit8514
@theit8514
Dec 07 2015 16:57
Regexes are seriously not my strong point. The lazy operators are a pain. It's detecting the [c] as part of the url because of the literal [ after the @?
The test fails, Expected Object({ url: '[c]/<@http://path/to/file.js', func: '.plugin/e.fn', args: [ ], line: 1, column: 1, context: null }) to equal Object({ url: 'http://path/to/file.js', func: '.plugin/e.fn[c]/<', args: [ ], line: 1, column: 1, context: null }). (1)
Blake Niemyjski
@niemyjski
Dec 07 2015 17:07
hmm
I’d grab the regex and go to an online regex builder that breaks it out
and enter the url in there
allows you to visual edit and debug it
theit8514
@theit8514
Dec 07 2015 18:55
All tests succeed when I change |\[ to |\[native code\].
Trying to check and see if 'native code' is localized or not.
Blake Niemyjski
@niemyjski
Dec 07 2015 19:14
hmm
but what does that change the url to?
what’s the regex inside of []?
theit8514
@theit8514
Dec 07 2015 19:32
The updated regex I used was /^\s*(.*?)(?:\((.*?)\))?@?((?:file|https?|blob|chrome|\[native code\]).*?)(?::(\d+))?(?::(\d+))?\s*$/i. The URL is unchanged in all tests, since the tests are looking for [native code].
If [native code] is localized though, that could be an issue.
Blake Niemyjski
@niemyjski
Dec 07 2015 19:32
what was it before?
theit8514
@theit8514
Dec 07 2015 19:33
|chrome|\[).*?
that is a greedy selector, which causes the [c] before the @ to be found and makes the @ part of .*?
Blake Niemyjski
@niemyjski
Dec 07 2015 19:41
hmm
is there something that does an index of ]
I thought that native code or [xyz] was used some place ore return as part of the stack
wonder if you could do a child group inside of the selector like
[.*]
theit8514
@theit8514
Dec 07 2015 19:46
not really, because that still detects [c] as part of the url.
Blake Niemyjski
@niemyjski
Dec 07 2015 19:50
Do you have a branch this is committed to?
also how was this exception thrown? guessing the test has the full stack trace
the url should only be the http: part
theit8514
@theit8514
Dec 07 2015 19:52
I updated the current test to include the failing line from the stacktrace and the expected output in the test framework. theit8514/TraceKit@fee48bb
theit8514
@theit8514
Dec 07 2015 20:18
Found a better solution, all tests work, and doesn't rely on 'native code' literal. /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[).*?)(?::(\d+))?(?::(\d+))?\s*$/i Matches any line that starts with just the URL (ie: [native code] or http://...) or has the @ symbol in it followed by the URL (ie: @[native code] or ...@http://...). theit8514/TraceKit@5499424
Blake Niemyjski
@niemyjski
Dec 07 2015 20:40
awesome!
Can you verify that there are no more regexes in there checking for [
I think there is a second regex but not sure
also what’s your thoughts on this..
do you think the function name should be e.fn with an arg of c
or no
guessing changing that will wreck the [native code stuff]
unless that became the function name which I think it is
Blake Niemyjski
@niemyjski
Dec 07 2015 20:46
theit8514
@theit8514
Dec 07 2015 20:46
Technically, c is the variable storing the function name. ie: $.fn[name] = function(options) {
It's always going to be 'c' or whatever the variable name is in the minified code.
Blake Niemyjski
@niemyjski
Dec 07 2015 20:47
yeah
good point
didn’t think about that
think we should cleanup the /< from it. I guess we don’t really know what other browsers do other than firefox
unless you know how to recreate that error in other browsers
I looked for the other regexes and they are only for inline functions or
for opera
if you think it’s good submit a pull request.
only thing I wonder about it as stated is if all the other browsers do the same url for that error but it might be hard to figure that out unless we can recreate it :)
theit8514
@theit8514
Dec 07 2015 20:51
Chrome reports it as at I.e.fn.(anonymous function) [as kendoMonthlyChart] (url)
Blake Niemyjski
@niemyjski
Dec 07 2015 20:51
do we handle that?
looking
theit8514
@theit8514
Dec 07 2015 20:52
element.func is "I.e.fn.(anonymous function) [as kendoMonthlyChart]"
And args is empty
Blake Niemyjski
@niemyjski
Dec 07 2015 20:54
I don’t see a case like that in our tests any where would it be possible to create it as a new test case (just asking as it will help us later and make the library better) with your chrome version (just replace the function names with something generic)
really appreciate your help with this
theit8514
@theit8514
Dec 07 2015 20:55
Okay to do one PR or separate?
Blake Niemyjski
@niemyjski
Dec 07 2015 20:57
yeah one pr is fine