Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Vivin Suresh Paliath
I have the same preference! That is exactly why I name functions even when they are function expressions. I am developing an API where having the name of the function in the stack trace would be a useful debugging aid as well. Yes the f$foo vs. foo is a different issue, but I would also prefer tha

Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Sundararajan Athijegannathan
Adding to what Hannes said: "stack" property and the format of stack trace are not part of ECMAScript standard. Implementations could differ in this. This is more of debugging aid as Hannes mentioned. I'd personally prefer names being shown in stack traces whenever possible - rather than being

Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Vivin Suresh Paliath
Thanks Hannes. I looked at the issue and it answered another question I had as well; I was wondering about the possibility of using a separator other than $ that is legal in Java, but not in JavaScript. On Thu, May 12, 2016 at 3:08 PM, Hannes Wallnoefer < hannes.wallnoe...@oracle.com> wrote: > Am

Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Hannes Wallnoefer
Am 2016-05-12 um 23:42 schrieb Vivin Suresh Paliath: Thanks for the explanation Hannes! The issue with $ makes sense; I ran into that some time ago - I can't remember the exact situation, but it was exactly as you described: the $ introduces ambiguity because it is a valid character and so coul

Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Vivin Suresh Paliath
Thanks for the explanation Hannes! The issue with $ makes sense; I ran into that some time ago - I can't remember the exact situation, but it was exactly as you described: the $ introduces ambiguity because it is a valid character and so could be part of the name of the original function, and not a

Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Hannes Wallnoefer
Hi Vivin, What you see is some fuzziness in the translation from JS functions to Java methods and from there to the stack traces you see. When we compile a JS function, we create a Java method with the name of the function concatenated to the names of its parent functions, using '$' as separ

Stacktraces from dynamically-constructed functions

2016-05-12 Thread Vivin Suresh Paliath
I have the following code: *var f = (function() {* *return function foo() {* *try {* *throw new Error();* *} catch(e) {* *print(e.stack);* *}* *}* *})();* When I call the function, I get the following stacktrace as expected (mostly; I was e

Stacktraces from dynamically-constructed functions

2016-05-12 Thread Vivin Suresh Paliath
Sorry to be sending this again, but I think there were some issues with my subscription to nashorn-dev. I have unsubscribed and so hopefully this should show up. I have the following code: *var f = (function() {* *return function foo() {* *try {* *throw new Error();* *

Re: Stacktraces from dynamically-constructed functions not as expected

2016-05-12 Thread Vivin Suresh Paliath
I tried this out on in chrome and I get the expected stack trace there. Is this a bug? On May 6, 2016 3:39 PM, "Vivin Suresh Paliath" wrote: > I have the following code: > > *var f = (function() {* > *return function foo() {* > *try {* > *throw new Error();* > *} c

Stacktraces from dynamically-constructed functions not as expected

2016-05-06 Thread Vivin Suresh Paliath
I have the following code: *var f = (function() {* *return function foo() {* *try {* *throw new Error();* *} catch(e) {* *print(e.stack);* *}* *}* *})();* When I call the function, I get the following stacktrace as expected (mostly; I was e