JavaScript over sensitive errors

Hi.

It seems JavaScript editing shows some things as errors that should
really be (if at all) warnings.

Examples for valid warnings (but may be not errors, at least in JavaScript):
1. Variable declared twice in the same scope.
2. function declared twice in the same scope.
3. variable / function declared in 2 different files. This is a common
method for JavaScript OO as in every file there's a (for example) _p
variable that is the ]]>.prototype.

I even get an error for inline use of functions, for example:
MyClass.prototype.f = function(e) {
var f = function(e) {};
};

IJ complains about the e parameter to the function put in var f
(Duplicate Declaration).

Anyone else experiencing this?

I'll probably enter this into JIRA.

BTW, JavaScript formatting just went a step back.

Comments?

Amnon

7 comments
Comment actions Permalink

BTW, JavaScript formatting just went a step back.


Comments?


0
Comment actions Permalink

Eugene Vigdorchik (JetBrains) wrote:
>>BTW, JavaScript formatting just went a step back.


Comments?


After some more trial, I found out that when an exception happens while
editing a JavaScript file, trying to continue and edit it makes the
editor behave weirdly.

For example, after an exception occurs write the following:
MyClass.prototype.f = function() {

Press Enter.
After an exception doing that adds a closing } but doesn't add a new row
or put the cursor in the correct place.

I have to take back that statement in part, as if an exception hasn't
occurred, formatting seems better (I tried the if {} else and it worked
fine unlike 3341).

Hope this is more useful info,
Amnon

0
Comment actions Permalink

Well,
this of course depends on what was the original exception. If you lost sync
between file and document,
then anything could happen:( (Hope you did post the exception to tracker?)
Still it is not the bug in javascript formatter that after all
makes me feel less unhappy=)

Eugene.

"Amnon I. Govrin" <nomail@jetbrains.com> wrote in message
news:d7igc0$u48$1@is.intellij.net...

Eugene Vigdorchik (JetBrains) wrote:
>>BTW, JavaScript formatting just went a step back.
>
>

Comments?

>
>

>

After some more trial, I found out that when an exception happens while
editing a JavaScript file, trying to continue and edit it makes the
editor behave weirdly.

>

For example, after an exception occurs write the following:
MyClass.prototype.f = function() {

>

Press Enter.
After an exception doing that adds a closing } but doesn't add a new row
or put the cursor in the correct place.

>

I have to take back that statement in part, as if an exception hasn't
occurred, formatting seems better (I tried the if {} else and it worked
fine unlike 3341).

>

Hope this is more useful info,
Amnon



0
Comment actions Permalink

Eugene Vigdorchik (JetBrains) wrote:

Well,
this of course depends on what was the original exception. If you lost sync
between file and document,
then anything could happen:( (Hope you did post the exception to tracker?)
Still it is not the bug in javascript formatter that after all
makes me feel less unhappy=)

Eugene.


I don't want to ever make you unhappy...

Yes, I have submitted the exception to tracker (the dialog said "Blame
JavaScript").

Amnon

0
Comment actions Permalink

Yes, I have submitted the exception to tracker (the dialog said "Blame
JavaScript").


Exception fixed.


0
Comment actions Permalink


"Amnon I. Govrin" <nomail@jetbrains.com> wrote in message
news:d7i76a$oic$1@is.intellij.net...

Hi.

>

It seems JavaScript editing shows some things as errors that should
really be (if at all) warnings.

>

Examples for valid warnings (but may be not errors, at least in

JavaScript):

1. Variable declared twice in the same scope.
2. function declared twice in the same scope.
3. variable / function declared in 2 different files. This is a common
method for JavaScript OO as in every file there's a (for example) _p
variable that is the <ClassName>.prototype.

>

I even get an error for inline use of functions, for example:
MyClass.prototype.f = function(e) {
var f = function(e) {};
};

>

IJ complains about the e parameter to the function put in var f
(Duplicate Declaration).


Fixed.


0
Comment actions Permalink

Eugene Vigdorchik (JetBrains) wrote:

Fixed.


Thanks (for both!)

Looking forward for the new build,

Amnon

0

Please sign in to leave a comment.