Implementing import keyword

Feb 24, 2010 at 11:57 PM
Edited Feb 25, 2010 at 2:11 PM

I looked up on Google that "import" is a Javascript reserved keyword.  Now, even though it isn't an ECMAScript reserved keyword and that is the primary focus of Jint, wouldn't it be practical though to get import implemented sooner rather than later so that there doesn't have to be so much ridiculous keyboard typing going on to reference .Net classes?

I hope the overwhelming majority of people here would say...YES!

Separate comment about jint in general:

I've been playing around with jint over the past several weeks and I guess my biggest frustration is the lack of useful error messages coming back from the try/catch.   I really don't want to go digging into some built-in debugging mode.   I'd just like a one-liner error message with a line number in the script in some coherent form that I could look at and say, "ah, okay, I know what the problem is with my Javascript code".   If I were an end-user and an error from my Javascript came back with no line number and the error "Unable to cast object of type 'Jint.Native.JsUndefined' to type 'Jint.Native.JsFunction'", after 20 mins of getting nowhere, I'd have to stop using whatever application the Javascript (jint) was embedded in. 

The only point of comparison I have is using a stock charting program called eSignal which uses SpiderMonkey for its scripting.   I can tell in 1 min what I did wrong in my JS code.  It should be just that simple and it's all based on user-centered error messages, not cryptic programmer-level error messages.   BTW, here's the error message that SpiderMonkey gave to a similar error in that eSignal program:  "template.js line 21: ReferenceError: preMain2 is not defined".   Oh, okay, I mistyped the function name I wanted to call.   How easy is that?

You guys have done all the hard parts of a project like this.  But no one will use it as an end-user if the error messages don't lead you to a solution within a minute or two on average.

Feb 26, 2010 at 2:35 PM

I concur with the error message issue. About half of the time I get meaningless error info, especially when calling a method on a undefined variable, which happen to me a lot. It makes me scratch head every time.

Feb 27, 2010 at 7:30 AM

Ok !

I had this message as a work item, and let you know about the progress. I thought it was already as simple as you want, have to recheck it.

Feb 27, 2010 at 7:30 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 27, 2010 at 7:31 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 27, 2010 at 8:30 AM

Hi Steve,

For you first question, what is the import keyword meant for ?

Sep 25, 2010 at 11:12 PM

I think it's meaning would be similar to VB.Net's Import, or C#'s using keyword - search a namespace for referenced classes.